question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TOC: duplicated anchors won't work

See original GitHub issue

The 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:closed
  • Created 4 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
pedropratescommented, Oct 25, 2019

Ok, thank you!!

0reactions
yzhang-ghcommented, Oct 25, 2019

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Wiki: Tips & Tricks to Fix the Article TOC (Table of Contents)
If any entry in the TOC does not link to the correct location, you probably have duplicate anchor tag names.
Read more >
TOC is adding duplicate sections and breaking page
On latest version of the plugin it just keeps adding duplicates list items and anchors of the same section. This ends up breaking...
Read more >
Identical Headers will not work when clicked in the TOC
Identical Headers will not work when clicked in the TOC. Closed: Assignee: Priority: Resolution: Closed. Unassigned. Low. Duplicate.
Read more >
How to fix toc hyperlink anchor scroll location in azure wikis ...
On the page preview, in the toc section (top of the page), if I select Sub-Topic 1 hyperlink under the Topic 2, then...
Read more >
221602 – Remote Help duplicate TOC entries - Bugs - Eclipse
The TocServlet does not always display the anchor correctly and the second Toc is treated as a top level book. This behaviour is...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found