derlin / bitdowntoc

Online and command-line Markdown TOC generator, with built-in support for BitBucket Server, GitHub, Gitlab, dev.to and more!
https://bitdowntoc.derlin.ch
Other
87 stars 8 forks source link

Further improve handling for code blocks nested in lists #26

Closed 0xdevalias closed 7 months ago

0xdevalias commented 9 months ago

I see that better support for code blocks nested in lists was added in this commit:

But if I am reading it correctly, I believe those changes still won't work properly in the case of a code block nested in a list on the same line (which is valid in GitHub Flavoured markdown, and maybe others)

eg.

- This is a list
- It has items
  - ```js
    console.log("Foo")


See also:

- https://github.com/naokazuterada/MarkdownTOC/pull/170
derlin commented 8 months ago

This is a very good point, thanks for letting me know! I will try to work on this soon.