-
Notifications
You must be signed in to change notification settings - Fork 43
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
Blade escapes html generated from markdown extra footnotes #44
Comments
We switched markdown parsers in v1.3.16, can you confirm if this is still an issue after updating? |
Hi @bakerkretzmar I have kept this tab open since April, and will get around to checking and answering your question. This whole pandemic has made my workload blow up and finding spare time to work on my personal projects has been difficult. |
No rush at all, stay safe! |
It appears this was a known issue in the Markdown parser used in v1.3.15 and prior versions, namely erusev/parsedown-extra#158. Here's a test using the Markdown parser used in v1.3.16 and beyond, which appears to have the correct behavior. require __DIR__ . '/vendor/autoload.php';
use Michelf\MarkdownExtra;
$my_text = <<<EOS
Here's a simple footnote,[^1] and here's a longer one.[^bignote]
[^1]: This is the first footnote.
[^bignote]: Here's one with multiple paragraphs and code.
Indent paragraphs to include them in the footnote.
`{ my code }`
Add as many paragraphs as you like.
EOS;
$my_html = MarkdownExtra::defaultTransform($my_text);
echo $my_html, PHP_EOL; Resulting HTML: <p>Here's a simple footnote,<sup id="fnref:1"><a href="#fn:1" class="footnote-ref" role="doc-noteref">1</a></sup> and here's a longer one.<sup id="fnref:bignote"><a href="#fn:bignote" class="footnote-ref" role="doc-noteref">2</a></sup></p>
<div class="footnotes" role="doc-endnotes">
<hr />
<ol>
<li id="fn:1" role="doc-endnote">
<p>This is the first footnote. <a href="#fnref:1" class="footnote-backref" role="doc-backlink">↩︎</a></p>
</li>
<li id="fn:bignote" role="doc-endnote">
<p>Here's one with multiple paragraphs and code.</p>
<p>Indent paragraphs to include them in the footnote.</p>
<p><code>{ my code }</code></p>
<p>Add as many paragraphs as you like. <a href="#fnref:bignote" class="footnote-backref" role="doc-backlink">↩︎</a></p>
</li>
</ol>
</div> I think this issue can be safely closed. |
Sounds good, @elazar thanks a lot for taking the time to check that out! |
When using footnotes from the extended markdown functionality I notice that footnote html is escaped e.g:
Oddly enough none of the other html produced by markdown seems to have been escaped.
The text was updated successfully, but these errors were encountered: