Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Making footnotes compatible with picky CMSes #33

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions bin/MultiMarkdown.pl
Original file line number Diff line number Diff line change
Expand Up @@ -1801,9 +1801,9 @@ sub _DoFootnotes {
if (defined $g_footnotes{$id} ) {
$g_footnote_counter++;
if ($g_footnotes{$id} =~ /^(<p>)?glossary:/i) {
$result = "<a href=\"#fn:$id\" id=\"fnref:$id\" title=\"see glossary\" class=\"footnote glossary\">$g_footnote_counter</a>";
$result = "<a name=\"fnref_$id\"></a><a href=\"#fn_$id\" title=\"see glossary\" class=\"footnote glossary\">$g_footnote_counter</a>";
} else {
$result = "<a href=\"#fn:$id\" id=\"fnref:$id\" title=\"see footnote\" class=\"footnote\">$g_footnote_counter</a>";
$result = "<a name=\"fnref_$id\"></a><a href=\"#fn_$id\" title=\"see footnote\" class=\"footnote\">$g_footnote_counter</a>";
}
push (@g_used_footnotes,$id);
}
Expand Down Expand Up @@ -1851,9 +1851,9 @@ sub _PrintFootnotes{
$glossary . ":<p>";
}egsx;

$result.="<li id=\"fn:$id\">$footnote<a href=\"#fnref:$id\" title=\"return to article\" class=\"reversefootnote\">&#160;&#8617;</a>$footnote_closing_tag</li>\n\n";
$result.="<li id=\"fn_$id\"><a name=\"fn_$id\"></a>$footnote<a href=\"#fnref_$id\" title=\"return to article\" class=\"reversefootnote\">&#160;&#8617;</a>$footnote_closing_tag</li>\n\n";
} else {
$result.="<li id=\"fn:$id\">$footnote<a href=\"#fnref:$id\" title=\"return to article\" class=\"reversefootnote\">&#160;&#8617;</a>$footnote_closing_tag</li>\n\n";
$result.="<li id=\"fn_$id\"><a name=\"fn_$id\"></a>$footnote<a href=\"#fnref_$id\" title=\"return to article\" class=\"reversefootnote\">&#160;&#8617;</a>$footnote_closing_tag</li>\n\n";
}
}
$result .= "</ol>\n</div>";
Expand All @@ -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
Expand Down