New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
False positive for stray end tags #841
Comments
Perhaps related, I'm also getting false positives for unclosed elements on this page: https://www.uwb.edu/brand/website/accessibility/examples/inaccessible-page |
For https://www.w3.org/WAI/demos/bad/before/home.html , I suspect it's related to the https://html.spec.whatwg.org/multipage/scripting.html#the-noscript-element
|
Ok, so not exactly a false positive, but rather a false attribution. |
Hm. If the problem is that a |
Can you doublecheck that? Here is minimal test case: <!doctype html>
<HTML lang="">
<title>test</title>
<noscript><b></b></noscript> That one has Here is another minimal test case: <!doctype html>
<HTML lang="">
<title>test</title>
<noscript></noscript> That one has no |
That is exactly the case. But it’s important to note that you’ll only see that behavior when scripting is disabled (as mentioned in the spec section you cited). When scripting is not disabled — which of course in the normal case in web browsers — then the parser actually won’t implicitly close that But the checker is not capable of checking documents with scripting enabled. The checker doesn’t have a JavaScript engine to execute script with. So the checker uses the HTML parser in “scripting disabled” mode. And in “scripting disabled” mode, the parser doesn’t evaluate the So exactly what happens here is that when the parser hits that So with scripting disabled, this is what the parser ends up putting into the DOM: …and this is what ends up getting rendered: |
Yeah, basically. The is just one of the many parts of the HTML parsing algorithm that is almost absurdly arcane and non-intuitive. So for this case, it’s very difficult to have the checker emit a user-friendly error message that clearly and succinctly explains what the root problem actually is. |
I don’t get any messages about unclosed elements on that page — Maybe something changed? It got updated in the meantime? |
I've been using the Check serialized DOM of current page bookmarklet rather than typing the URL into the Nu HTML Checker page. I did it both ways just now and got different results. Wasn't expecting that. :-(
|
I think this is resolved per the comments above. If not, let me know and we can reopen it. |
Page: https://www.w3.org/WAI/demos/bad/before/home.html
The Nu HTML Checker reports two stray end tags on this page, but both have corresponding start tags.
Error: Stray end tag noscript.
From line 142, column 70; to line 142, column 80
/FONT></B></noscript>↩ <
LL comment: The start tag is on the same line as the end tag (142).
Error: Stray end tag head.
From line 144, column 3; to line 144, column 9
script>↩ </head>↩ <bo
LL comment: The start tag is on line 1.
The text was updated successfully, but these errors were encountered: