Re: [whatwg/url] [Editorial] Simplify the ends-in-a-number checker (#633)

@annevk commented on this pull request.



>   <li>
   <p>If <var>last</var> is non-empty and contains only <a>ASCII digits</a>, then return true.
 
-  <p class=note>This can happen if <var>last</var> starts with "<code>0</code>" so the
-  <a lt="IPv4 number parser">IPv4 number parser</a> tries to parse it as octal, but it is not a
-  valid octal number, as is the case with, for example, "<code>09</code>".
+  <p class=note>The erroneous input "<code>09</code>" will be caught by the <a>IPv4 parser</a> at a
+  later stage.
+
+ <li>
+  <p>If parsing <var>last</var> as an <a lt="IPv4 number parser">IPv4 number</a> does not return
+  failure, then return true.
+
+  <p class=note>This is equivalent to checking that <var>last</var> starts with "<code>0X</code>"
+  or "<code>0x</code>", followed by zero or more <a>ASCII hex digits</a>.

How about changing "starts with" to "is"?

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

Received on Wednesday, 20 October 2021 05:17:56 UTC