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
If a document with headings containing special characters is printed to HTML, generated ToC links point to slugified ids, while <h1> , <h2>, etc. tags are given a non-slugified id, breaking the link.
What's the expected result
header tags in the generated HTML are given slugified ids.
How to reproduce
Take the following sample document:
# BROKEN TOC DEMO## test1, comma
lorem ipsum
## test2 — em dash
dolor sit
Generate a ToC with Levels=2..6 and Slugify Mode=github (although the issue should be reproducible with any other Levels and Slugify Mode setting too). The following should be obtained:
I also noticed that the generated HTML header tags always have two ids.
If the markdown header didn't include characters removable by slugify, both the generated ids in the HTML header tags are equal, so the first one gets kept, and the link is not broken
If the markdown header did include special characters, in the generated HTML, the first id to appear in HTML header tags is the "malformed", non-slugified one, and since it appears first, that is what gets read by the browser, and the correct one is ignored. The HTML spec does specify that only one ID is allowed per DOM element.
The text was updated successfully, but these errors were encountered:
What's the problem
If a document with headings containing special characters is printed to HTML, generated ToC links point to slugified ids, while
<h1>
,<h2>
, etc. tags are given a non-slugified id, breaking the link.What's the expected result
header tags in the generated HTML are given slugified ids.
How to reproduce
Levels
=2..6
andSlugify Mode
=github
(although the issue should be reproducible with any otherLevels
andSlugify Mode
setting too). The following should be obtained:Other information
I also noticed that the generated HTML header tags always have two ids.
The text was updated successfully, but these errors were encountered: