Keep an in-word apostrophe from splitting the word in Pascal/Camel/Snake/Kebab/Macro [patch] - #85
Merged
Merged
Conversation
…ake/Kebab/Macro [patch]
ReplaceNonAlphaNumericWithSpace turned every apostrophe into a space, so
"don't stop" became "DonTStop" and "don_t_stop", disagreeing with
ToTitleCase, which keeps "Don't" as one word. An apostrophe (' or U+2019)
with a letter on each side is now dropped instead; one anywhere else
still separates words.
Fixes #83
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012mvcqKMc35CMobct1fmizc
|
This was referenced Sep 28, 2026
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.



Fixes #83
What changed
ReplaceNonAlphaNumericWithSpaceturned every apostrophe into a space, so the letters after it became a separate word. It feeds both the Pascal/Camel path and the Snake/Kebab/Macro path. Now an apostrophe ('or U+2019) with a letter on each side is dropped. An apostrophe anywhere else, such as a leading or trailing quote or80's, still separates words.don't stopToPascalCaseDonTStopDontStopdon't stopToCamelCasedonTStopdontStopdon't stopToSnakeCasedon_t_stopdont_stopdon't stopToMacroCaseDON_T_STOPDONT_STOPo'neilToPascalCase/ToSnakeCaseONeil/o_neilOneil/oneilToTitleCasedoes not go through this helper and is unchanged. It already keepsDon'tas one word.Tests
ApostropheWithinWordShouldNotSplitItcovers every row in the issue for both'and U+2019, across Pascal, Camel, Snake, Kebab and Macro. Its rows fail with the fix reverted.ApostropheNotBetweenLettersShouldStillSeparateWordschecks that quotes,rock 'n' rolland80'sstill separate words.This branch is independent of #86 (the fix for #82), and the two merge cleanly in either order.
🤖 Generated with Claude Code
https://claude.ai/code/session_012mvcqKMc35CMobct1fmizc