Skip to content

fix(web): decode percent-escapes in link pill display text - #152

Merged
vnykmshr merged 1 commit into
mainfrom
fix/link-pill-decode-segments
Aug 7, 2026
Merged

fix(web): decode percent-escapes in link pill display text#152
vnykmshr merged 1 commit into
mainfrom
fix/link-pill-decode-segments

Conversation

@vnykmshr

@vnykmshr vnykmshr commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator

Found reviewing the release candidate. Keeping the path in the link pill (#151) meant wire encoding started reaching the reader: https://exämple.de/über rendered as exä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 %2F cannot 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: StaysWithinPillBudget implied 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.

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.
@vnykmshr
vnykmshr merged commit a6e743d into main Aug 7, 2026
8 checks passed
@vnykmshr
vnykmshr deleted the fix/link-pill-decode-segments branch August 7, 2026 11:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant