Skip to content

feat(link-helper): improve ASCII normalization handling#911

Merged
xoofx merged 3 commits intoxoofx:masterfrom
mos379:Linkhelper
Nov 10, 2025
Merged

feat(link-helper): improve ASCII normalization handling#911
xoofx merged 3 commits intoxoofx:masterfrom
mos379:Linkhelper

Conversation

@mos379
Copy link
Contributor

@mos379 mos379 commented Oct 29, 2025

feat(link-helper): improve ASCII normalization handling

Enhanced the Urilize method to better handle ASCII normalization and special characters. Added support for decomposing characters when allowOnlyAscii is true and skipping diacritical marks. Introduced handling for special German, Scandinavian, and Icelandic characters via new helper methods: IsSpecialScandinavianOrGermanChar and NormalizeScandinavianOrGermanChar.

Reorganized using directives for better clarity. Updated the processing loop in Urilize to handle normalized spans and ASCII equivalents more effectively. These changes improve link generation compatibility across various languages.
#910

Enhanced the `Urilize` method to better handle ASCII normalization and special characters. Added support for decomposing characters when `allowOnlyAscii` is true and skipping diacritical marks. Introduced handling for special German, Scandinavian, and Icelandic characters via new helper methods: `IsSpecialScandinavianOrGermanChar` and `NormalizeScandinavianOrGermanChar`.

Reorganized `using` directives for better clarity. Updated the processing loop in `Urilize` to handle normalized spans and ASCII equivalents more effectively. These changes improve link generation compatibility across various languages.
@xoofx
Copy link
Owner

xoofx commented Nov 6, 2025

Sorry to come back on this only now. Some tests are failing, if you could have a look? Thanks!

@mos379
Copy link
Contributor Author

mos379 commented Nov 6, 2025

Gotta fix the tests, working on it.
Actually I'll see what Copilot can do :D

mos379 and others added 2 commits November 6, 2025 10:30
Added tests for NormalizeScandinavianOrGermanChar method to validate character normalization for various special characters in both ASCII and non-ASCII contexts.
Updated test cases in `TestUrilizeOnlyAscii_Simple` to reflect
changes in `LinkHelper.Urilize` behavior. Non-ASCII characters
like `æ` and `ø` are now transliterated to their ASCII
equivalents (`ae` and `oe`) instead of being removed.
@xoofx xoofx merged commit 12590e5 into xoofx:master Nov 10, 2025
1 check passed
@mos379
Copy link
Contributor Author

mos379 commented Nov 10, 2025

Great Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants