markdown-viewer icon indicating copy to clipboard operation
markdown-viewer copied to clipboard

Section link across page doesn't work

Open Kimi-Arthur opened this issue 5 years ago • 3 comments
trafficstars

This is what I observed: If there is a link to another local md file with section title, like [text](../some_file.md#section-1), it will open it, but won't scroll to the position. And if you modify the current url to Section-1, it will scroll there. Capitalisation is not the problem, it's just another url for the section.

Also, if I'm opening the same page in another tab with a new section id, it won't scroll (it will stick to the old location).

What I guess: When the page first loads, there is no such an id like section-1, as maybe the extension hasn't processed the page yet. However, after the page loads and I change the url in the same tab, the page knows that id and will scroll.

Kimi-Arthur avatar Mar 25 '20 11:03 Kimi-Arthur

Thanks for the detailed bug report, I'll have a look :+1:

simov avatar Mar 27 '20 15:03 simov

I wonder how local links work: text ok, but how to set the destination? html style with does not work, also

title {#xxx} is interpreted verbatim.

I miss that aspect in the documentation. If i dont know how it should work by intention, i dont know whether it is ok.

Reissner avatar Apr 06 '20 08:04 Reissner

I think this extension generates the id for each section title automatically, which is pretty nice and works if referenced in the same page.

Kimi-Arthur avatar Apr 06 '20 09:04 Kimi-Arthur

The autoscroll behavior was updated in v5.1 Now the extension either scrolls to the last known position in the page or to a header if a hash fragment is present in the URL. I'm closing this issue for now, but let me know if that works for you.

simov avatar Mar 18 '23 08:03 simov