Repository navigation
Conversation
The fold ran every character of an affected token through the confusables map, including U+2019, whose prototype is ASCII "'". So "Ivа’s" (Cyrillic а) normalized to "Iva's" instead of "Iva’s". The apostrophe is punctuation the token admits, not a lookalike; leave it as typed. Detection is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
What & why
When a word with a lookalike letter gets folded, its typographic apostrophe was
folded too:
The fold ran every character of the token through the confusables map, and U+2019's
prototype is
'. The apostrophe is punctuation the token is allowed to have, not alookalike, so now it stays as typed. Detection is unchanged:
Ivа’sis stillmixed_scriptandspoofed.Small follow-up to the curly-apostrophe handling in #16.
Tests: a case in
test/cases.data.tsand a test inanalyze.test.ts(
Ivа’s,Ivа's, andthe boss’ НОТ’ deal→the boss’ HOT’ deal).Checklist
pnpm lint && pnpm check-types && pnpm test && pnpm buildpass locallypnpm changeset) if this is a user-facing change (patch)Found while maintaining an extended version at https://github.com/cycanics/unicode-spoofing.
🤖 Generated with Claude Code