Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
KEINOS opened this issue Mar 6, 2019 · 0 comments
Open

Comments

@KEINOS
Copy link
Owner

KEINOS commented Mar 6, 2019

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>
KEINOS added a commit that referenced this issue Jun 24, 2020
Use Parsedown Extra anchors identifiers. This might help issue #3.
@KEINOS KEINOS mentioned this issue Jan 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant