TOC: duplicated anchors won't work
See original GitHub issueThe table of contents successfully differentiate duplicated headers with different anchors, based on this issue #211, but the anchor created for the duplicated header, won’t work neither on PDF nor HTML (the link won’t connect to the header).
For example:
Introduction
Some small introduction
New Method
Introduction
New method introduction
The first Introduction header will have a #introduction anchor, while the second Introduction, the one below the New Method, will have a different anchor #introduction-1. When exporting to PDF (or HTML), PDF readers (or browsers, when dealing with HTML) won’t acknowledge the second anchor as linking to the second Introduction header, probably because of the additional -1 on the end of the header name, and therefore the second Introduction on the Table Of Contents won’t be clickable.
Is there another way to deal with duplicate headers and anchors in a way that it won’t break the link on PDF readers?
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (3 by maintainers)

Top Related StackOverflow Question
Ok, thank you!!
I also don’t have a good solution (for PDF) now. That is why this extension doesn’t provide such a feature (#270).
Personally, I export Markdown to HTML (using this extension) and then use Chrome to print HTML to PDF.