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
Currently, for XML and HTML, we are capturing at best \w which translate into [a-zA-Z0-9_]. But tag names can contains almost any unicode characters after the first char (this one must be [a-zA-Z] for HTML, a bit more permissive for XML).
Tag name patterns for both HTML and XML now accept non-ASCII characters, so <math-α>, <emotion-😍-emoji> and <données> are highlighted as a whole.
HTML: the first character still has to be an ASCII letter, as the spec requires (<αtag> is not highlighted).
XML: non-ASCII characters are also allowed as the first character, following NameStartChar.
I kept the patterns byte-based (non-ASCII bytes \x80-\xFF) rather than adding the /u modifier, so input with invalid UTF-8 still gets highlighted instead of failing silently.
Unicode in attribute names isn't covered yet. I can open a follow-up PR if that's wanted.
Activity
Akiyo974 commentedon Oct 20, 2026
Hi @afu-dev , I opened #237 to fix this.
Tag name patterns for both HTML and XML now accept non-ASCII characters, so
<math-α>,<emotion-😍-emoji>and<données>are highlighted as a whole.<αtag>is not highlighted).NameStartChar.I kept the patterns byte-based (non-ASCII bytes
\x80-\xFF) rather than adding the/umodifier, so input with invalid UTF-8 still gets highlighted instead of failing silently.Unicode in attribute names isn't covered yet. I can open a follow-up PR if that's wanted.