Table of contents in markdown documents

I noticed a bug in DevonThink with markdown documents and the table of contents.
In my document I have two chapters on h1 level, below these chapters I have sub-chapters with the same headlines. If I use the table of contents and click on the second sub-chapter with duplicate name (but under different h1 level), the view of the source code jumps to the correct headline, but the markdown view jumps to the first occurrence of the headline in the document.

Here is an example structure:

Level 1


Level 2


In the table of contents, if I click on the Sub-Level below Level 2, the source code view jumps to the correct headline, but the markdown view jumps to the Sub-Level headline below Level 1.

Could you please check this issue? Thanks!

This is not a bug.
You have two headings with the same name. This causes an inconsistency since there is an id for each heading.

Well for me as a user, this feels like a bug, because it is working for the source code view, but not the markdown view.

Again, it is not a bug. You can’t have multiple items with the same id. This is non-negotiable HTML behavior.

You need to manually define a separate id for any heading with redundant titles, e.g.,…

You can also designate a separate id for any other purpose with this method, should anyone choose to.

PS: The source view is not the rendered view. The rendered view is HTML, which circles back to the inherent error your code is causing.

1 Like

Ok, now I got it. With your mentioned method of using separate ids in brackets, it works as expected. Thanks for your support.

You’re welcome. Happy Markdowning! :wink:

1 Like