erusev / parsedown-extra

Markdown Extra Extension for Parsedown

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Footnote HTML is double-escaped when safe mode is on

al2k4 opened this issue · comments

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>.&#160;<a href="#fnref1:1" rev="footnote" clas
s="footnote-backref">&#8617;</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">
&lt;p&gt;&lt;a href="https://github.com/erusev/parsedown-extra"&gt;Parsedown Extra&lt;/a&gt; is an extension of &lt;a href="/"&gt;Parsedown&lt;/a&gt; that adds support for &lt;a href="https://michelf.ca/projects/php-markdown/extra/"&gt;Markdown Extra&lt;/a&gt;.&am
p;#160;&lt;a href="#fnref1:1" rev="footnote" class="footnote-backref"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
</li>
</ol>
</div>
commented

Is there any update on this?