Repository navigation
fix(gist): preserve Unicode at title truncation boundaries - #4941
Open
dajiaohuang wants to merge 1 commit into
Open
dajiaohuang wants to merge 1 commit into
dajiaohuang wants to merge 1 commit into
Conversation
|
@dajiaohuang is attempting to deploy a commit to the github readme stats Team on Vercel. A member of the Team first needs to authorize it. |
This branch has not been deployed
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.
A gist filename containing an emoji at the title truncation boundary leaves an isolated high surrogate in the generated SVG. For example, 34 ASCII characters followed by an emoji produce malformed Unicode when the header is sliced at 35 UTF-16 units. The same happens with
show_owner=truewhen the owner/name header crosses that boundary.Remove a trailing high surrogate from the truncated prefix before appending the ellipsis. This preserves the existing 35-unit limit and keeps emoji that fit completely within it.
Added three synthetic rendering regressions covering the filename boundary, owner/name boundary, and a fully fitting emoji. Before the fix, the Gist suite has 14 passing and 2 failing tests; afterward all 16 pass.
Validation on Linux with Node 22.14.0 (matching
.nvmrcand CI): all 27 unit suites / 245 tests / 9 snapshots pass; lint, benchmark tests, full format check, andgit diff --checkpass. A preliminary Windows Node 24 run passed 244 tests and hit the existing rank floating-point assertion covered by #4639; no rank code or tests were changed. No live hosted cards, real provider data, or private tokens were used.