Skip to content

fix: preserve case for Ę, Ī, Ķ, Ū in charmap#211

Closed
greymoth-jp wants to merge 1 commit into
simov:masterfrom
greymoth-jp:fix-charmap-uppercase-case
Closed

fix: preserve case for Ę, Ī, Ķ, Ū in charmap#211
greymoth-jp wants to merge 1 commit into
simov:masterfrom
greymoth-jp:fix-charmap-uppercase-case

Conversation

@greymoth-jp

Copy link
Copy Markdown

Four uppercase letters in config/charmap.json map to lowercase ASCII, while every other uppercase entry maps to uppercase:

  • Ę (U+0118) was e
  • Ī (U+012A) was i
  • Ķ (U+0136) was k
  • Ū (U+016A) was u

Since lower is off by default, this drops the capital on transliteration. Ā works but Ū does not, even though they sit in the same block:

slugify('Ķīpsala') // 'kipsala'  (expected 'Kipsala')
slugify('Īsts')    // 'ists'     (expected 'Ists')
slugify('Ūla')     // 'ula'      (expected 'Ula')

The replace polish chars and replace latvian chars tests carried the same typo. For example the Latvian table had 'Ā': 'A' and 'Ī': 'i' on the same line.

I changed the four values to E, I, K, U, regenerated slugify.js with npm run build, and fixed those two test tables. The lowercase counterparts (ę, ī, ķ, ū) are unchanged. All 45 tests pass.

These four uppercase letters mapped to lowercase ASCII (e, i, k, u)
while every other uppercase entry maps to uppercase, so slugify lost
the capital, e.g. slugify('Ķīpsala') returned 'kipsala' instead of
'Kipsala'. Map them to E, I, K, U and fix the Polish/Latvian test
tables, which encoded the same typo.
@Trott

Trott commented Jun 29, 2026

Copy link
Copy Markdown
Collaborator

Duplicate of #209.

@Trott Trott closed this Jun 29, 2026
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.

2 participants