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

Footnote HTML is double-escaped when safe mode is on #158

Open
al2k4 opened this issue Oct 5, 2020 · 1 comment
Open

Footnote HTML is double-escaped when safe mode is on #158

al2k4 opened this issue Oct 5, 2020 · 1 comment

Comments

@al2k4
Copy link

al2k4 commented Oct 5, 2020

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>
@secure-77
Copy link

Is there any update on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants