kjdev / hoextdown

Hoextdown is an extension to Hoedown
MIT License
23 stars 15 forks source link

Footnote definitions that are wrapped intuitively give the wrong result #4

Closed jasharpe closed 9 years ago

jasharpe commented 9 years ago

Example:

foo[^1]

[^1]: foo

      * list

      not in list

Expected:

<p>foo<sup id="fnref1"><a href="#fn1" rel="footnote">1</a></sup></p>
<div class="footnotes">
<hr>
<ol>

<li id="fn1">
<p>foo&nbsp;<a href="#fnref1" rev="footnote">↩</a></p>

<ul>
<li>list</li>
</ul>

<p>not in list</p>
</li>

</ol>
</div>

Actual:

<p>foo<sup id="fnref1"><a href="#fn1" rel="footnote">1</a></sup></p>
<div class="footnotes">
<hr>
<ol>

<li id="fn1">
<p>foo&nbsp;<a href="#fnref1" rev="footnote">↩</a></p>

<ul>
<li><p>list</p>

<p>not in list</p></li>
</ul>
</li>

</ol>
</div>

It may not be easy to see from the HTML, but "not in list" is included under the "list" list, when it probably shouldn't be. The workaround is to only indent the footenote def lines by 4 spaces instead of 6. This works, but looks bad in the raw Markdown.

jasharpe commented 9 years ago

Woohoo! Thanks. :)