Footnote HTML is double-escaped when safe mode is on
al2k4 opened this issue · comments
al2k4 commented
Parsedown: 1.7.4
ParsedownExtra: 0.8.1
Script
require "vendor/autoload.php";
$pd = new ParsedownExtra();
$pd->setSafeMode(true);
$md = <<<EOD
Welcome to the demo of Parsedown Extra [^1]:
1. Write Markdown text on the left
2. Hit the __Parse__ button or `⌘ + Enter`
3. See the result to on the right
This is an interactive demo of
[^1]: [Parsedown Extra](https://github.com/erusev/parsedown-extra) is an extension of [Parsedown](/) that adds support for [Markdown Extra](https://michelf.ca/projects/php-markdown/extra/).
EOD;
echo $pd->text($md);
Expected Output:
<p>Welcome to the demo of Parsedown Extra <sup id="fnref1:1"><a href="#fn:1" class="footnote-ref">1</a></sup>:</p>
<ol>
<li>Write Markdown text on the left</li>
<li>Hit the <strong>Parse</strong> button or <code>⌘ + Enter</code></li>
<li>See the result to on the right</li>
</ol>
<p>This is an interactive demo of</p>
<div class="footnotes">
<hr />
<ol>
<li id="fn:1">
<p><a href="https://github.com/erusev/parsedown-extra">Parsedown Extra</a> is an extension of <a href="/">Parsedown</a> that adds support for <a href="https://michelf.ca/projects/php-markdown/extra/">Markdown Extra</a>. <a href="#fnref1:1" rev="footnote" clas
s="footnote-backref">↩</a></p>
</li>
</ol>
</div>
Actual Output:
<p>Welcome to the demo of Parsedown Extra <sup id="fnref1:1"><a href="#fn%3A1" class="footnote-ref">1</a></sup>:</p>
<ol>
<li>Write Markdown text on the left</li>
<li>Hit the <strong>Parse</strong> button or <code>⌘ + Enter</code></li>
<li>See the result to on the right</li>
</ol>
<p>This is an interactive demo of</p>
<div class="footnotes">
<hr />
<ol>
<li id="fn:1">
<p><a href="https://github.com/erusev/parsedown-extra">Parsedown Extra</a> is an extension of <a href="/">Parsedown</a> that adds support for <a href="https://michelf.ca/projects/php-markdown/extra/">Markdown Extra</a>.&am
p;#160;<a href="#fnref1:1" rev="footnote" class="footnote-backref">&#8617;</a></p>
</li>
</ol>
</div>
sec77 commented
Is there any update on this?