You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Heading: Generated anchors split words in scripts that use combining marks, such as Hindi, Tamil and Bengali #85095
When the editor generates anchors for Heading blocks, combining marks are treated as separators and turned into hyphens. In scripts like Devanagari, Tamil and Bengali, vowel signs, the virama and the anusvara are combining marks (Unicode category M), so the anchor splits every word apart:
Heading
Generated anchor
Expected
हिंदी व्याकरण
ह-द-व-य-करण
हिंदी-व्याकरण
தமிழ் மொழி
தம-ழ-ம-ழ
தமிழ்-மொழி
বাংলা ভাষা
ব-ল-ভ-ষ
বাংলা-ভাষা
Text typed with decomposed accents (a letter followed by a combining accent such as U+0300) has the same problem. Crème Brûlée typed that way gets cre-me-bru-le-e, while the precomposed form gets creme-brulee.
Anchors are only generated when the generateAnchors editor setting is on, or when the post has a Table of Contents block.
The cause is getSlug() in packages/block-library/src/heading/autogenerate-anchors.js, which turns anything that is not a letter or a number ([^\p{L}\p{N}]) into a hyphen. #84896 fixed this for post slugs (cleanForSlug() now keeps Devanagari vowel signs), but heading anchors are generated by separate code.
Step-by-step reproduction instructions
Turn on anchor generation, for example with this must-use plugin:
Activity