See this post, and the mailing list post it originates from:
I tried to link to a specific comment in a GitLab issue, using a URL with a fragment identifier (
#note_2772684). But the link preview changes/canonicalizes the link, losing the fragment identifier.
The URL I posted was:
But the link preview changes the URL to
Which looks like this, linking to the top of the issue, not the comment of 2022-01-26 I wanted:
My guess is that the forum is taking the
og:url metadata property from the Open Graph tags on the page. The linked-to page has:
<meta content="https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake/-/issues/40095" property="og:url">
Ideally, the forum would retain URL fragment identifiers even after canonicalizing the URL, in the same way the browsers keep the fragment after following redirects.
Notice how another URL in the post, https://www.freedesktop.org/software/systemd/man/systemd.exec.html#Process%20Properties, does not have Open Graph tags, does not get a link preview, and keeps its fragment identifier.