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

Broken autolink when two or more _ (underscores) used in the title #142

Closed szymonpk closed 4 years ago

szymonpk commented 4 years ago

First of all, thanks for the awesome plugin! I tried to dig into this myself, but I couldn't find an easy solution. Autolinking generates the wrong TOC when multiple underscores (_) are used.

How can the issue be reproduced

# One_title

# An_other_title

What was expected

<!-- MarkdownTOC autolink="true" -->

- [One_title](#one_title)
- [An_other_title](#an_other_title)

<!-- /MarkdownTOC -->

What actually occurred

<!-- MarkdownTOC autolink="true" -->

- [One_title](#one_title)
- [An_other_title](#anothertitle)

<!-- /MarkdownTOC -->

Notice missing _ from second title.

What was the version of the involved component

MarkdownTOC v3.0.4 and Sublime 3.2.2 build 3211

naokazuterada commented 4 years ago

@szymonpk Hi, thank you for reporting. I also confirmed that there was a bug. Sorry! I will fix it in a week.

naokazuterada commented 4 years ago

@szymonpk

Sorry for late reaction. Your problem will be fixed in 3.0.5. Please check it!

szymonpk commented 4 years ago

@naokazuterada thank you very much! My case is fixed.

Although, I found another one :/

<!-- MarkdownTOC autolink="true" -->

- [t_h_i_s](#thi_s)

<!-- /MarkdownTOC -->

# t_h_i_s

Looks like single characters are the issue. Should I create another issue?

naokazuterada commented 4 years ago

@szymonpk Hi, thank you for your detailed report! I released fix release at 4.0.0. Please check "Upgrade Guide" on the release note and make sure your settings updated.

szymonpk commented 4 years ago

Thank you very much!