[PR #2489] [MERGED] fix: strip diacritics from team URL slug generation #2338

Closed
opened 2026-02-26 20:33:27 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/documenso/documenso/pull/2489
Author: @Jahangirbabar2000
Created: 2/13/2026
Status: Merged
Merged: 2/16/2026
Merged by: @dguyen

Base: mainHead: fix/2466-strip-diacritics-team-url-v2


📝 Commits (1)

  • 394a2d3 fix: strip diacritics from team URL slug generation (#2466)

📊 Changes

1 file changed (+7 additions, -3 deletions)

View changed files

📝 apps/remix/app/components/dialogs/team-create-dialog.tsx (+7 -3)

📄 Description

Description

When creating a team with accented characters in the name (e.g. "Développement", "Ström"), the auto-generated Team URL slug retains diacritical marks. Since the Team URL validator only allows letters, numbers, dashes, and underscores, this causes validation to fail — making it impossible to create teams with accented names.
This PR adds Unicode NFD normalization to the mapTextToUrl function in TeamCreateDialog.tsx to strip diacritical marks before lowercasing and replacing spaces.

Fixes #2466

Changes Made

  1. Added .normalize('NFD') to decompose accented characters into their base letter + combining accent mark
  2. Added .replace(/[\u0300-\u036f]/g, '') to remove the combining diacritical marks, leaving only ASCII base characters
  3. Both steps are applied before the existing .toLowerCase() and .replace(/\s+/g, '-') transformations

Testing Performed

  • Tested team creation with Ström — URL field now correctly generates strom instead of ström
  • Tested with Développement — generates developpement
  • Tested with Équipe Générale — generates equipe-generale
  • Tested with São Paulo — generates sao-paulo
  • Tested with naïve — generates naive
  • Tested with non-accented names like Engineering — no change in behavior
  • Verified that the Team URL validation passes after the fix and teams can be created successfully

Checklist

  • I have tested these changes locally and they work as expected.
  • I have added/updated tests that prove the effectiveness of these changes.
  • I have updated the documentation to reflect these changes, if applicable.
  • I have followed the project's coding style guidelines.
  • I have addressed the code review feedback from the previous submission, if applicable.

Additional Notes

The fix is a single function change in mapTextToUrl. The approach uses the standard String.normalize('NFD') method which decomposes characters like é into e + a combining acute accent, then strips all combining marks via regex. This covers French, Spanish, German, Portuguese, Nordic, and other Latin-script diacritics.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/documenso/documenso/pull/2489 **Author:** [@Jahangirbabar2000](https://github.com/Jahangirbabar2000) **Created:** 2/13/2026 **Status:** ✅ Merged **Merged:** 2/16/2026 **Merged by:** [@dguyen](https://github.com/dguyen) **Base:** `main` ← **Head:** `fix/2466-strip-diacritics-team-url-v2` --- ### 📝 Commits (1) - [`394a2d3`](https://github.com/documenso/documenso/commit/394a2d3ed89ed668921b1e5364393ff09acd6027) fix: strip diacritics from team URL slug generation (#2466) ### 📊 Changes **1 file changed** (+7 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `apps/remix/app/components/dialogs/team-create-dialog.tsx` (+7 -3) </details> ### 📄 Description ## Description When creating a team with accented characters in the name (e.g. "Développement", "Ström"), the auto-generated Team URL slug retains diacritical marks. Since the Team URL validator only allows letters, numbers, dashes, and underscores, this causes validation to fail — making it impossible to create teams with accented names. This PR adds Unicode NFD normalization to the mapTextToUrl function in TeamCreateDialog.tsx to strip diacritical marks before lowercasing and replacing spaces. ## Related Issue Fixes #[2466](https://github.com/documenso/documenso/issues/2466) ## Changes Made 1. Added .normalize('NFD') to decompose accented characters into their base letter + combining accent mark 2. Added .replace(/[\u0300-\u036f]/g, '') to remove the combining diacritical marks, leaving only ASCII base characters 3. Both steps are applied before the existing .toLowerCase() and .replace(/\s+/g, '-') transformations ## Testing Performed - Tested team creation with Ström — URL field now correctly generates strom instead of ström - Tested with Développement — generates developpement - Tested with Équipe Générale — generates equipe-generale - Tested with São Paulo — generates sao-paulo - Tested with naïve — generates naive - Tested with non-accented names like Engineering — no change in behavior - Verified that the Team URL validation passes after the fix and teams can be created successfully ## Checklist <!--- Please check the boxes that apply to this pull request. --> <!--- You can add or remove items as needed. --> - [x] I have tested these changes locally and they work as expected. - [ ] I have added/updated tests that prove the effectiveness of these changes. - [ ] I have updated the documentation to reflect these changes, if applicable. - [x] I have followed the project's coding style guidelines. - [ ] I have addressed the code review feedback from the previous submission, if applicable. ## Additional Notes The fix is a single function change in mapTextToUrl. The approach uses the standard String.normalize('NFD') method which decomposes characters like é into e + a combining acute accent, then strips all combining marks via regex. This covers French, Spanish, German, Portuguese, Nordic, and other Latin-script diacritics. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-26 20:33:27 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/documenso#2338
No description provided.