From 9e518012abaf7ed39c489486e76e37c6b3440094 Mon Sep 17 00:00:00 2001 From: Nano Date: Sat, 9 Jul 2011 22:09:47 -0400 Subject: [PATCH] Changed colons to underscores and added anchors w/ names for footnotes Posterous (and possibly other CMS systems) does not like colons in the "id" or "name" attributes of html elements. Also, it strips out "id" attributes for most elements (including the "li" element of the MMdown footnote). So this commit adds "a name=fn_footnoteid" elements to the footnote "li" elements, as well as changing the footnote name/id to "fn_footnoteid" rather than "fn:footnoteid". --- bin/MultiMarkdown.pl | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/bin/MultiMarkdown.pl b/bin/MultiMarkdown.pl index 8f36adf..487c454 100755 --- a/bin/MultiMarkdown.pl +++ b/bin/MultiMarkdown.pl @@ -1801,9 +1801,9 @@ sub _DoFootnotes { if (defined $g_footnotes{$id} ) { $g_footnote_counter++; if ($g_footnotes{$id} =~ /^(

)?glossary:/i) { - $result = "$g_footnote_counter"; + $result = "$g_footnote_counter"; } else { - $result = "$g_footnote_counter"; + $result = "$g_footnote_counter"; } push (@g_used_footnotes,$id); } @@ -1851,9 +1851,9 @@ sub _PrintFootnotes{ $glossary . ":

"; }egsx; - $result.="

  • $footnote ↩$footnote_closing_tag
  • \n\n"; + $result.="
  • $footnote ↩$footnote_closing_tag
  • \n\n"; } else { - $result.="
  • $footnote ↩$footnote_closing_tag
  • \n\n"; + $result.="
  • $footnote ↩$footnote_closing_tag
  • \n\n"; } } $result .= "\n"; @@ -1878,7 +1878,7 @@ sub Header2Label { } sub id2footnote { - # Since we prepend "fn:", we can allow leading digits in footnotes + # Since we prepend "fn_", we can allow leading digits in footnotes my $id = shift; my $footnote = lc $id; $footnote =~ s/[^A-Za-z0-9:_.-]//g; # Strip illegal characters