fix(web): decode percent-escapes in link pill display text - #152
Merged
Conversation
Keeping the path meant wire encoding reached the reader — a unicode path rendered as "exämple.de/%C3%BCber". Decoding happens after the segment split so an encoded %2F cannot invent a boundary, and before the cap so it counts displayed characters.
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.
Found reviewing the release candidate. Keeping the path in the link pill (#151) meant wire encoding started reaching the reader:
https://exämple.de/überrendered asexämple.de/%C3%BCber. Not a regression against v3.30.1 — the path was not shown at all before — but it is ugliness the previous PR introduced, on exactly the non-English paths where it looks worst.Decoding happens after the segment split, so an encoded
%2Fcannot invent a segment boundary, and before the length check, so the cap counts characters the reader actually sees rather than their expansion.Also makes a test honest:
StaysWithinPillBudgetimplied a guarantee that does not hold for a hostname longer than the budget, which is returned whole and left to the CSS ellipsis on purpose — truncating it would emit something that is not a hostname. That case now has its own test naming it as intended behavior, so the CSS fallback is documented rather than assumed.