1

I would like to link to a text fragment, like so:

https://pvk.ca/Blog/2019/01/09/preemption-is-gc-for-memory-reordering/#event-counts-with-x86-tso-and-futexes:~:text=However%2C%20if%20we%20go

This link1 has a fragment as follows:

#event-counts-with-x86-tso-and-futexes:~:text=However%2C%20if%20we%20go

This links to the text "However, if we go" which appears part way down the page, with the heading with id event-counts-with-x86-tso-and-futexes as the fallback. However, when clicking this link in Chrome, the targetted text is only briefly shown, and then the page scrolls to the #event-counts-with-x86-tso-and-futexes heading.

If remove the #event-counts-with-x86-tso-and-futexes part of the fragment (like this) it works fine, but then there is no fallback for browsers such as firefox which don't support linking to text.


1 Oddly, clicking that link here in the question doesn't seem to work at all, but if you copy and paste the link above, it does. Probably SO is encoding the link somehow, wrecking the fragment?

BeeOnRope
  • 60,350
  • 16
  • 207
  • 386

1 Answers1

1

In this case the distance between the text fragment and the ID is very big. Mixing both is definitely supported and works fine when both are close enough together (example).

For your last question in the footnote, probably StackOverflow isn't opening links with a noopener context.

DenverCoder9
  • 2,024
  • 11
  • 32