Repository navigation
Conversation
|
|
||
| ### Bug Fixes | ||
|
|
||
| - `cleanForSlug`: keep combining marks so slugs in scripts like Devanagari, Tamil and Bengali are no longer mangled ([#40023](https://github.com/WordPress/gutenberg/issues/40023)). |
There was a problem hiding this comment.
| - `cleanForSlug`: keep combining marks so slugs in scripts like Devanagari, Tamil and Bengali are no longer mangled ([#40023](https://github.com/WordPress/gutenberg/issues/40023)). | |
| - `cleanForSlug`: keep combining marks so slugs in scripts like Devanagari, Tamil and Bengali are no longer mangled ([#83525](https://github.com/WordPress/gutenberg/issues/83525)). |
Nit: changelog should reference the PR number.
There was a problem hiding this comment.
Good catch, fixed. The entry links this PR now.
jorgefilipecosta
left a comment
There was a problem hiding this comment.
I think we have an issue with emojis something like "I ❤️ WordPress" now leaves an invisible U+FE0F in the slug.
|
I checked this in Playground with this PR (WordPress 7.1.3). The URL field saves I can also confirm Jorge's concern. The branch also needs a rebase, since GitHub shows conflicts. |
🤖 PR meta 🤖🎉 PropsUnlinked AccountsThe following contributors have not linked their GitHub and WordPress.org accounts: @pratikgandhi14. Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases. If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. Updated as activity occurs, without notifying anyone named here. Add the |
e00350f to
998016a
Compare
|
Thanks @jorgefilipecosta for catching this, and @ekamran for testing all those cases. Variation selectors and enclosing marks are now stripped before the mark check, so The Devanagari and Tamil cases still keep their matras and halant, so the original fix is intact. Tests now cover the emoji and keycap cases and fail without the change. Changelog links this PR, and the branch is rebased on trunk. |
|
Thanks @Kgupta62, and @ekamran and @jorgefilipecosta for testing. #84896 ports core’s sanitize_title() and closes #40023. The Devanagari vowel signs are kept, and emoji are kept whole like core does, so the variation-selector problem goes away too. Closing as superseded. |
What?
Closes #40023
cleanForSlugkeeps the combining marks that scripts like Devanagari, Tamil and Bengali need, while Latin accents are still removed.Why?
The final filter only kept letters and numbers. The vowel signs these scripts use are combining marks, so they were deleted and words got mangled. For example, typing
अलग-अलग प्रकार के प्लंबिंग ट्रैप्सinto the slug field savesअलग-अलग-परकर-क-पलबग-टरपस.How?
The filter now also allows
\p{M}. A new step strips the Latin combining range (U+0300 to U+036F) first, so decomposed input likeCrèmestill becomescreme.Testing Instructions
अलग-अलग प्रकार के प्लंबिंग ट्रैप्सinto the slug field and click away. The slug should keep every character.Crème Brûléestill becomescreme-brulee.npm run test:unit -- packages/urlTesting Instructions for Keyboard
Type the slug and Tab out of the field; the result should be the same.
Use of AI Tools
Claude Code was used to help investigate the issue and draft the patch and its test. I reviewed the change, ran the tests locally, and take responsibility for the result.