medfreeman / markdown-it-toc-and-anchor

markdown-it plugin to add a toc and anchor links in headings
MIT License
60 stars 35 forks source link

Expecting robust processing of irregular headdings #32

Open simonmysun opened 7 years ago

simonmysun commented 7 years ago

This input fails on my computer:

## Heading 2
#### Heading 4
medfreeman commented 7 years ago

After studying the question, it seems that the idea to use a markdown representation for these kind of broken unordered lists was a bad idea after all. Conflicts with fenced code blocks among other things arise when having empty list levels between entries. I'll switch back to a tree to html representation in the next version, removing the markdown callback option. This will be a breaking change anyway, although not sure if anyone uses this feature.

simonmysun commented 7 years ago

Thank you very much for your effort!

The problem I met is that, I need real time rendering for changing texts. When user alter the content, the middle state could be unpredictable, which includes the problem described here.