You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Duplicate header names aren't differentiated in IDs #879
Other markdown parsers support having multiple sections with the same name, but this one doesn't.
Input:
# test# test
Expected Output:
<h1id="test">test</h1><h1id="test-1">test</h1>
Actual Output:
<h1id="test">test</h1><h1id="test">test</h1>
Supporting this means subsections can go by the same name. (for instance, in an md file I have, I have a section for specifications of files, and another section for examples of the files in action, and each section needs a subsection of the same name, as they're the same file)
There are probably other use cases as well. Also supporting this would make it not be invalid html =P
Reacted by TheBotDev, Ravi Theja and Eric Veilleux
Activity
charlieTheBotDev commentedon Apr 27, 2017
I'm using
markdown-tocto insert a table of contents in one of my projects and wrote a workaround for this that handles duplicates in the same way.Input
Output
ES6 Version
ES5 Version
I'm pretty sure this is how all markdown parsers handle duplicates
It also works fine if you remove the
<!-- toc -->and don't usetoc.insertcarmacleod commentedon Oct 12, 2017
This is also causing Eclipse Orion bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=525834
joshbruce commentedon Dec 25, 2017
See #981