naokazuterada / MarkdownTOC

SublimeText3 plugin which generate a table of contents (TOC) in a markdown document.
https://packagecontrol.io/packages/MarkdownTOC
MIT License
301 stars 48 forks source link

fix remove_items_in_codeblocks regex for codeblocks nested in lists #170

Open 0xdevalias opened 7 months ago

0xdevalias commented 7 months ago

The current regex within remove_items_in_codeblock doesn't properly match codeblocks nested inlists, which results in invalid ToC generation (often meaning large chunks of actual content get incorrectly filtered out due to bad matching between opening/closing code fence backticks)

This PR fixes the regex so that it will correctly match when a codeblock is nested in a list started with - or *.

0xdevalias commented 3 months ago

@naokazuterada Any chance of getting this reviewed/merged/released?