Harmonizing TOC link behavior in Markdown and PDF

hello,

this is a simple request to make the behavior in Markdown files the same as in PDF files.

Currently, when clicking a PDF TOC item, one is transported to the resp. ‘bookmark’/part of the PDF and the relevant target is set on top of the viewer. Thus one can immediately glance the target section and the content underneath – which in almost all cases will be the relevant content, resp. the expected/wished-for behavior.

Now, in Markdown documents it seems that clicking any TOC link for downstream sections will ‘bring up’ the relevant line – but at the bottom of the document.
This is not only unexpected, and not in line with the traditional behavior of PDFs, but it also occludes the relevant content after the highlighted/scrolled-to section, which is unpractical in most circumstances.

Can the MD-behavior be streamlined with the (traditional) one in the PDF? :folded_hands:

1 Like

What you click „in an MD“ document probably happens in its preview. All you see in an MD document of the TOC is {{TOC}}, which is not clickable.
After this pedantic explanation: the behavior of the links in a TOC of an MD preview depends on the HTML engine that handles the clicks. I doubt that DT has any influence on that. But I might be wrong, of course.

The simple preposition ‘in’ might cause confusion here.
As the comparison between PDF and MD suggests, this request is concerned with the behaviour stemming from links in DTs right sidepanel, that is DTs own ‘automatic TOC’.