Simplify ends in a number checker · whatwg/url@12c0c5c
annevk
·
2026-07-01
·
via Recent Commits to url:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -1099,22 +1099,19 @@ false), and then runs these steps. They return failure or a <a for=/>host</a>.
|
1099 | 1099 | runs these steps. They return a boolean. |
1100 | 1100 | |
1101 | 1101 | <ol> |
| 1102 | +<li><p>Assert: <var>input</var> is not the empty string. |
| 1103 | + |
1102 | 1104 | <li><p>Let <var>parts</var> be the result of <a>strictly splitting</a> <var>input</var> on |
1103 | 1105 | U+002E (.). |
1104 | 1106 | |
1105 | | -<li> |
1106 | | -<p>If the last <a for=list>item</a> in <var>parts</var> is the empty string, then: |
1107 | | - |
1108 | | -<ol> |
1109 | | -<li><p>If <var>parts</var>'s <a for=list>size</a> is 1, then return false. |
1110 | | - |
1111 | | -<li><p><a for=list>Remove</a> the last <a for=list>item</a> from <var>parts</var>. |
1112 | | -</ol> |
| 1107 | +<li><p>If the last <a for=list>item</a> in <var>parts</var> is the empty string, then |
| 1108 | +<a for=list>remove</a> the last <a for=list>item</a> from <var>parts</var>. |
1113 | 1109 | |
1114 | 1110 | <li><p>Let <var>last</var> be the last <a for=list>item</a> in <var>parts</var>. |
1115 | 1111 | |
1116 | 1112 | <li> |
1117 | | -<p>If <var>last</var> is non-empty and contains only <a>ASCII digits</a>, then return true. |
| 1113 | +<p>If <var>last</var> is not the empty string and contains only <a>ASCII digits</a>, then return |
| 1114 | + true. |
1118 | 1115 | |
1119 | 1116 | <p class=note>The erroneous input "<code>09</code>" will be caught by the <a>IPv4 parser</a> at a |
1120 | 1117 | later stage. |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。