When I write a link to a text fragment, like this, the link works in the editor preview properly (on the linked page skips to the given text fragment and highlights it), but on the published question, it works only as a normal link and doesn't skip to the given text fragment and does not highlight it. How can this be fixed?



(You can check my link by starting to edit this question and click on the link in the preview. It will work (it highlights the "spinors in three-dimensions" text fragment), however in the original question it doesn't work in the sense written above.)

  • This was tagged as a bug in the linked duplicate. As explained in that question, this is happening because SE escapes the tilde character which is used in text fragments. Keep in mind that this is a non-standard functionality which is only used in Chrome so it's less likely that they will fix it. Nov 10, 2023 at 15:11
  • 1
    Reading the duplicate question, you can work around this issue by typing HTML for the link directly. So instead of clicking the link button in the editor toolbar or using markdown, you can type <a href="https://en.wikipedia.org/blah">this</a> Nov 10, 2023 at 15:22
  • As I noted in a comment on the proposed duplicate, this is actually a bug in Chromium's/Chrome's implementation of non-standard functionality, not in SE's code. The issue should be reported to them, so they actually fix it. Essentially, Chrome/Chromium should be treating the encoded %7E exactly as if it was a ~.
    – Makyen
    Nov 10, 2023 at 15:31
  • @Makyen I would argue that Chrome should not treat an encoded tilde the same as ~. The purpose of escaping special characters is that they don't perform their expected function. Same as escaping a ? in a URL which is normally used for starting a query string. Nov 10, 2023 at 15:40
  • 1
    @CaveJohnson Great! This solved my problem! (If you write this into an Answer, I will accept it).
    – mma
    Nov 10, 2023 at 15:44
  • Great, personally I'd rather this question be closed as a duplicate of the other question, as that other question has the solution I mentioned within it. Nov 10, 2023 at 15:47
  • 1
    @CaveJohnson Unfortunately, the other question doesn't have an Answer, only comments.
    – mma
    Nov 10, 2023 at 15:48
  • Re "it doesn't work": Can you be more specific? For example, does it show the raw Markdown source instead of a (live) link? Nov 11, 2023 at 2:55
  • @This_is_NOT_a_forum Done in the OP.
    – mma
    Nov 11, 2023 at 6:00


Browse other questions tagged .