Browse Source

Markdown.pl: retain square brackets around footnotes

If the document contains footnote style links (e.g. [1],
[2], [3] ...) they look much better formatted so as to
retain the square brackets in the link text.

Do this for any footnote style link text consisting of
one to three digits.

Signed-off-by: Kyle J. McKay <mackyle@gmail.com>
master
Kyle J. McKay 7 years ago
parent
commit
dfbf2b4e30
  1. 3
      Markdown.pl

3
Markdown.pl

@ -851,6 +851,7 @@ sub _DoAnchors {
$title =~ s!([*_~])!$g_escape_table{$1}!g;
$result .= " title=\"$title\"";
}
$link_text = '[' . $link_text . ']' if $link_text =~ /^\d{1,3}$/;
$result .= ">$link_text</a>";
}
else {
@ -897,6 +898,7 @@ sub _DoAnchors {
$result .= " title=\"$title\"";
}
$link_text = '[' . $link_text . ']' if $link_text =~ /^\d{1,3}$/;
$result .= ">$link_text</a>";
$result;
@ -929,6 +931,7 @@ sub _DoAnchors {
$title =~ s!([*_~])!$g_escape_table{$1}!g;
$result .= " title=\"$title\"";
}
$link_text = '[' . $link_text . ']' if $link_text =~ /^\d{1,3}$/;
$result .= ">$link_text</a>";
}
else {

Loading…
Cancel
Save