Skip to content

Commit

Permalink
new syntax for auto-generated footnote [[^ footnote here]]
Browse files Browse the repository at this point in the history
replaces current [[fn footnote here]] experimental syntax, legacy syntax
support remains
  • Loading branch information
vendeeglobe committed May 14, 2022
1 parent 5de438e commit e964c03
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions wacko/formatter/class/wackoformatter.php
Expand Up @@ -935,8 +935,9 @@ function wacko_callback($things)

return ($sup ? '<sup>' : '') . '<a href="#' . $ahref . '" id="o' . $ahref . '">' . $text . '</a>' . ($sup ? '</sup>' : '');
}
// autogenerated footnote [[fn footnote here]]
else if (mb_substr($url, 0, 2) == 'fn')
// auto-generated footnote [[^ footnote here]]
else if ( mb_substr($url, 0, 2) == 'fn' // legacy support for experimental syntax [[fn footnote here]]
|| $url[0] == '^')
{
$sup = 1;

Expand All @@ -962,6 +963,7 @@ function wacko_callback($things)

return ($sup ? '<sup class="footnote">' : '') . '<a href="#footnote-' . $footnote_count . '" id="footnote-' . $footnote_count . '-ref" title="footnote ' . $footnote_count . '" >[' . $footnote_count . ']</a>' . ($sup ? '</sup>' : '');
}
// forced links
else
{
if ($url != ($url = (preg_replace('/<!--markup:1:[\w]+-->|<!--markup:2:[\w]+-->|\[\[|\(\(/u', '', $url))))
Expand Down

0 comments on commit e964c03

Please sign in to comment.