Cannot deep link to anchor in text

I have followed the instructions on this page in order to link directly to headings in my post, including using the special heading-- format for the link, eg. heading–h.pv1t5s7p1t7x:

However, it’s not working:

Any advice? Thanks!

1 Like

I use this as a manual anchor code:

<a name="header-name"></a>

#header-name (for in-post)

https://meta.discourse.org/t/cannot-deep-link-to-anchor-in-text/212393/2#header-name (for if you want to use the link outside the topic)

Eg - https://meta.discourse.org/t/cannot-deep-link-to-anchor-in-text/212393/2#header-name

There’s also the DiscoTOC theme component that might be worth a look?

3 Likes

You can also try to user the automatic header anchor feature

# headline1
### headline3
##### headline5

headline1

headline3

headline5

Link to headline1 https://meta.discourse.org/t/cannot-deep-link-to-anchor-in-text/212393/3#headline1-1

2 Likes

That’s good. :+1: I was tricked into thinking that they no longer worked when I couldn’t grab the header-link by clicking on one. :slightly_smiling_face:

1 Like

You need to click at the gap in front of the headline.

2 Likes

I used to tap on the header, and a link icon would appear on the left of it that I could then grab the link from, but it no longer does that. Tapping on the gap doesn’t seem to do anything?

Edit: I spoke too soon. :slightly_smiling_face: I’m with you now. Long-pressing on the gap does the job. :+1: I was waiting for a link icon to show up. Thank you. :slightly_smiling_face:

My only issue with the auto-one is that adding another header in later throws of the header numbers in the existing links, so you need to be careful if it’s a document that’s prone to additions/deletions.

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.