Footer link href drops URL fragment (#anchor) — query string is kept but hash is stripped #6254
howdy39
started this conversation in
Bugs & Feedback
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
When a footer link in
docs.json(footer.links[].items[].href) contains a URL fragment (e.g.#ai), the fragment is stripped from the rendered link. The query string on the same URL is preserved, but the hash is dropped. As a result, the link cannot deep-link to an on-page anchor on the destination site.Expected behavior
The
hrefis documented as typestring (uri), and a fragment is a valid URI component (RFC 3986). The full URL — including its fragment — should be passed through unchanged to the rendered<a href>.Actual behavior
The fragment is removed. The query string survives, so the result is asymmetric:
docs.jsonvaluehrefhttps://example.com/terms?foo=true#aihttps://example.com/terms?foo=truehttps://example.com/terms#aihttps://example.com/termsIn both cases
#aiis gone.Steps to reproduce
docs.json:mint devand open the local prevdocsConfigJSON in the served HTML).Observed result
In the embedded
docsConfigof the served page, the value is already normalized to:The fragment is gone before render, so this looks like it happens during config parsing/normalization rather than
at the DOM level.
Environment
4.2.632v24.17.0mint devNotes
The inconsistency (query string preservedan unintended side effect of URL
Beta Was this translation helpful? Give feedback.
All reactions