Closed ig-vb closed 4 years ago
Hi @ig-vb
What does the anchored ID look like? does it match the generated autolink
with the consecutive dashes:
<a id="#second---title"></a>
or is it different?
Do the links work even though they do not resemble the titles exactly.
Hi @jonasbn
The generated autolink
is:
- [Second - title](#second---title)
but the anchored ID is different.
This title:
Second - title
will get this anchor:
#second-title
So the links do not work. Correct, working link, generated by the plugin should be:
- [Second - title](#second-title)
Hello, everybody.
I can't reproduce the issue reported here, neither in MarkdownTOC 3.0.4 nor in the recently updated to 3.0.5. The generated markup with the example given is:
<!-- MarkdownTOC autolink="true" -->
- [One title](#one-title)
- [Second - title](#second---title)
<!-- /MarkdownTOC -->
<a id="one-title"></a>
# One title
<a id="second---title"></a>
# Second - title
The ID second---title
is a valid ID and it's functional.
After further testing, the generated links work with GitHub, but they are not working in GitLab.
It seems that the plugin is working correctly, the problem seems to be at GitLab. Please close this issue if you agree.
@ig-vb
Hi, you can deal with this by:
{
"id_replacements": [
{
"pattern": "\\s+",
"replacement": "-"
}
]
}
↓
{
"id_replacements": [
{
"pattern": "\\s+",
"replacement": ""
}
]
}
on your user settings (MarkdownTOC.sublime-setting).
Thank you!
Autolinking generates wrong TOC when dash (- ) used in the title.
How can the issue be reproduced
What was expected
What actually occurred
What was the version of the involved component
MarkdownTOC v3.0.5 and Sublime 3.2.2 build 3211