Repository navigation
Route external link hrefs through a shared URL helper - #5615
Merged
Merged
Conversation
Extract the href scheme handling from the attribution builder into a shared `sanitizeHref` util and apply it in `VLink` for external links, so both link paths normalise URLs the same way. Adds unit coverage. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
obenland
requested review from
dhruvkb and
obulat
and
a lite review from Copilot
September 10, 2026 18:43
Add cases for mixed-case schemes, control-character and whitespace obfuscation, encoded (non-decoded) inputs, and a reactive prop update, plus safe-URL regressions. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Latest k6 run output1Footnotes
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The attribution builder already normalised link URLs through a small private helper. This lifts that logic into a shared
sanitizeHrefutil and reuses it in the sharedVLinkcomponent so all external links go through the same URL handling instead of two slightly different paths.sanitizeHreftofrontend/shared/utils/sanitize-href.ts(single source of truth;http/https/mailtopass through, other explicit schemes are normalised toabout:blank, relative/scheme-less URLs untouched).attribution-html.tsnow imports it (behaviour unchanged).VLink.vueapplies it to external hrefs.Internal (
/…) links and normalhttp(s)/mailtolinks are unaffected; rendered output is identical for those.Testing Instructions
cd frontend && pnpm test:unit sanitize-href v-link attribution-htmlChecklist
🤖 Generated with Claude Code