Anchor links not working within Discourse - but work from outside the topic

Hi,

I am having problems creating deep links to headings in posts. They work when I open them in a new browser tab or window but in the post itself or in replies they do not. I get to the top of the page when I click them.

To help with reproducing this, I created an example topic on try.discourse.org - but I realize this will go away in a few hours, so will to try to reproduce this here in a moment.

What I looked at

I searched for previous mentions of this but only found this reply on the Linking to a heading within a post or topic guide that seems to point at the same problem. It is relatively recent (Nov 2025).

2 Likes

Ok, trying to reproduce this here by linking to the What I looked at heading above.

Does “outside” refer to outside of the forum or outside of the topic but within the forum?

I wonder if your problem is this bug Anchors Not Working Across Posts Within Topic

Ah, sorry. By “outside” in the title I meant that they work from, say, a notification email. Then I realized they also work when opening a new tab or window. You can see this with the link in my first reply. Clicking on it while already on the page gets to the top of the topic. If you open it in a new tab, it opens with the heading at the top as expected.

As to the previous bug report: unfortunately, none of the links in this work now. Also, it is from 2022 - this is not the kind of edge case bug that goes unfixed for that long?

I hope I am not holding the wrong end of the stick here. I was able to reproduce the problem on try.discourse.org, on meta.discourse.org as well as our own hosted forum.

1 Like

Yes, you can repro here by clicking the link with (works) and without (doesn’t work) the control key.
I suspect this is Ember routing causing issues.

1 Like

Thanks for confirming. I’ve moved this over to the Bug category. Hope that was the right next step.