Re: [whatwg/dom] Allow more characters in element/attribute names and prefixes (PR #1079)

@domenic commented on this pull request.



> +
+ <li><p>Return true.
+</ol>
+
+<p class=note>This concept is used to validate [=/element=] [=Element/local names=], when
+constructed by DOM APIs. The intention is to allow any name that is possible to construct using the
+HTML parser (the branch where the first [=code point=] is an [=ASCII alpha=]), plus some additional
+possibilities. For those additional possibilities, the ASCII range is restricted for historical
+reasons, but beyond ASCII anything is allowed.
+
+<div class=note>
+ <p>The following JavaScript-compatible regular expression is an implementation of the above
+ definition:
+
+ <pre class=lang-javascript>
+  /^(?:[A-Za-z][^\0\t\n\f\r\u0020/>]*)|(?:[:_\u0080-\u{10FFFF}][A-Za-z0-9-.:_\u0080-\u{10FFFF}]*)$/u

Thank you! I've fixed the regexp.

Re-running your test, it says

> Should have been valid element local name, regex said was invalid element local name:
>
> - codePoints: [98,105,103,69,109,111,106,105,127345,56689,65039,32], rendered string: bigEmoji🅱️ 

However I think this is correctly categorized by the regexp as invalid, because of the trailing code point 32 (U+0020, space). So something's slightly off in the rest of the test harness?

-- 
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/dom/pull/1079#discussion_r2094830698
You are receiving this because you are subscribed to this thread.

Message ID: <whatwg/dom/pull/1079/review/2849370293@github.com>

Received on Monday, 19 May 2025 04:52:41 UTC