Skip to content

Link from ToC won't work if multiple headings with the same content #3

@KEINOS

Description

@KEINOS

If there are more than 2 headers/headings which has the same content, the generated ToC html also has the same anchor. In this case the link from ToC won't work.

Even though Markdownlint has a regulation for it (MD024), not every one uses a linter.

[toc]

---
# Head1
Sample text of head 1.
## SameHead
Sample text of head 1-1.
# Head2
Sample text of head 2.
## SameHead
Sample text of head 2-1.
<ul>
<li><a href="#Head1">Head1</a><ul>
<li><a href="#SameHead">SameHead</a></li>
</ul>
</li>
<li><a href="#Head2">Head2</a><ul>
<li><a href="#SameHead">SameHead</a></li>
</ul>
</li>
</ul>
<hr />
<h1 id="Head1" name="Head1">Head1</h1>
<p>Sample text of head 1.</p>
<h2 id="SameHead" name="SameHead">SameHead</h2>
<p>Sample text of head 1-1.</p>
<h1 id="Head2" name="Head2">Head2</h1>
<p>Sample text of head 2.</p>
<h2 id="SameHead" name="SameHead">SameHead</h2>
<p>Sample text of head 2-1.</p>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions