Skip to content

Fix slugify for accented characters and apostrophes#46

Open
mhulet wants to merge 1 commit intobuildermethods:mainfrom
mhulet:fix/slugify-i18n
Open

Fix slugify for accented characters and apostrophes#46
mhulet wants to merge 1 commit intobuildermethods:mainfrom
mhulet:fix/slugify-i18n

Conversation

@mhulet
Copy link

@mhulet mhulet commented Feb 27, 2026

Summary

  • Normalize Unicode (NFD) and strip diacritics so accented characters map to their ASCII equivalents (ée, üu)
  • Remove apostrophes (straight and typographic) without inserting hyphens (d'accueildaccueil)

This fixes section ID matching for non-English titles (French, Spanish, German, etc.).

Test plan

  • Verify "Page d'accueil" slugifies to page-daccueil
  • Verify "Fonctionnalités" slugifies to fonctionnalites
  • Verify "Témoignages" slugifies to temoignages
  • Verify existing ASCII-only titles are unaffected

🤖 Generated with Claude Code

The slugify function was stripping accented characters entirely (é→nothing)
and inserting hyphens around apostrophes (d'accueil→d-accueil). This broke
section ID matching for French, Spanish, German, and other languages.

- Normalize Unicode NFD and strip diacritics (é→e, ü→u)
- Remove apostrophes without inserting hyphens

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.

1 participant