Rules Hub
Coding Rules Library
← Back to all rules
Rule priority, scope & exceptions
Use this to align rules with the senior-level structure (P0/P1/P2, scope, exceptions/tradeoffs).
fullstack ruleP1universalStack: javascript
slugsurlsi18ncorrectness
Transliterate special characters in slugs, don't drop them
When building URL slugs from names, replace national/diacritic characters with ASCII equivalents instead of deleting them, to preserve meaning and search.
PR: frontpage-web · org-mining-hist-2026-06Created: Jun 18, 2026
Bad example
Old codetypescript
| 1 | name.replace(/[æøå]/g, ''); // 'Bodø' -> 'Bod' |
Explanation (EN)
Objašnjenje (HR)
Good example
New codetypescript
| 1 | name.replace(/æ/g,'ae').replace(/ø/g,'o').replace(/å/g,'a'); // 'Bodø' -> 'Bodo' |
Explanation (EN)
Objašnjenje (HR)