Skip to content

Commit 7f2a144

Browse files
sideshowbarkerhsivonen
authored andcommitted
Emit error (not warning) for HTML4/XHTML1 doctype
Since 2594493 HTML4/XHTML1 doctypes have caused the warning `Obsolete doctype. Expected <!DOCTYPE html>`. This change makes that message an error rather than just a warning — bringing the parser into conformance with whatwg/html@31c20af (whatwg/html#2049).
1 parent 719ceb2 commit 7f2a144

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/nu/validator/htmlparser/impl/TreeBuilder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -768,7 +768,7 @@ public final void doctype(@Local String name, String publicIdentifier,
768768
systemIdentifier))
769769

770770
) {
771-
warn("Obsolete doctype. Expected \u201C<!DOCTYPE html>\u201D.");
771+
err("Obsolete doctype. Expected \u201C<!DOCTYPE html>\u201D.");
772772
} else if (!((systemIdentifier == null || Portability.literalEqualsString(
773773
"about:legacy-compat", systemIdentifier)) && publicIdentifier == null)) {
774774
err("Legacy doctype. Expected \u201C<!DOCTYPE html>\u201D.");

0 commit comments

Comments
 (0)