erusev / parsedown-extra

Markdown Extra Extension for Parsedown

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Footnotes don't work correctly in markdown="1" blocks

barazd opened this issue · comments

Original md code:

<div markdown="1">
Test...[^1]
</div>

[^1]: Footnote inside div

Excepted output (how PHP Markdown Extra generates it):

<div>
    <p>Test...<sup id="fnref:1"><a href="#fn:1" class="footnote-ref">1</a></sup></p>
</div>

<div class="footnotes">
    <hr />
    <ol>
        <li id="fn:1"><p>Footnote inside div</p></li>
    </ol>
</div>

Actual output (by Parsedown Extra):

<div markdown="1">
    <p>Test...[^1]</p>
</div>

If I write the footnote definition in the HTML block, it works, but it generates the footnote block inside the HTML block and restarts the numbering for each HTML block.

<div markdown="1">
Test...[^1]

[^1]: Footnote inside div
</div>

I think the Parsedown Extra should follow the method of PHP Markdown Extra.