- From: Joey Arhar <notifications@github.com>
- Date: Fri, 16 May 2025 17:16:56 -0700
- To: whatwg/dom <dom@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
- Message-ID: <whatwg/dom/pull/1079/review/2847788500@github.com>
@josepharhar 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 Thanks for making this regex! I think it's very useful for checking against my test and implementation. I'm not sure that this regex is correct, or maybe my test and implementation is wrong, or maybe I'm using the regex incorrectly. Here is a test that I derived from the WPT I'm writing which shows which test cases I don't think match up: https://codepen.io/jarhar/pen/azzMgMP -- Reply to this email directly or view it on GitHub: https://github.com/whatwg/dom/pull/1079#pullrequestreview-2847788500 You are receiving this because you are subscribed to this thread. Message ID: <whatwg/dom/pull/1079/review/2847788500@github.com>
Received on Saturday, 17 May 2025 00:17:00 UTC