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

Incorrect underscore handling #161

Closed aw-was-here closed 3 years ago

aw-was-here commented 3 years ago

It would appear that underscores aren't consistently being escaped, probably when other metacharacters are involved.

How can the issue be reproduced

I was updating https://github.com/aw-was-here/buretoolbox/blob/11d21546623a005a2ff2b763c7c377ed81e2e922/asf-site-src/source/documentation/in-progress/precommit-buildtools.html.md as it has gotten horribly out of sync. Upon doing that, I noticed the bug on save.

[I haven't tried making a smaller test case, but figure the "real thing" is likely good enough.]

What was expected

  * [pluginname\_\(test\)\_logfilter](#pluginname_test_logfilter)
  * [pluginname\_\(test\)\_calcdiffs](#pluginname_test_calcdiffs)

What actually occurred

  * [pluginname\_\(test\)\_logfilter](#pluginname_test_logfilter)
  * [pluginname\_\(test\)_calcdiffs](#pluginname_test_calcdiffs)

(Notice the lack of the backslash prior to _calcdiffs.

What was the version of the involved component

4.1.1

jonasbn commented 3 years ago

hey @aw-was-here

What was the reason for closing the bug? - if there is an issue we would love to address it when we have time.

Please advice

aw-was-here commented 3 years ago

I'm actually pretty certain it was a bug in the actual headers. So rather than waste your time on it, I've closed it and will re-submit if I see it again.

jonasbn commented 3 years ago

Thanks for the explanation @aw-was-here

Take care and stay safe