FSX / misaka

A Python binding for Hoedown.
http://misaka.61924.nl
MIT License
418 stars 65 forks source link

Incorrect Rendering of TOC #81

Closed noisytoken closed 4 years ago

noisytoken commented 4 years ago

Considee the following code:

https://pastebin.com/mVHV6keK

It generates the following incorrect markup

<ul>
<li>
<a href="#toc_0">H1</a>
<ul>
<li>
<a href="#toc_1">H2</a>
</li>
</ul>
</li>
<li>
<a href="#toc_2">a comment</a>
</li>
</ul>

The text a comment is part of the fenced code block. Hence, it shouldn't be part of the TOC.

FSX commented 4 years ago

You need to enable the fenced code block extension. Otherwise headers from fenced code blocks are also included in the TOC.