Skip to content

Commit a555f57

Browse files
Streamline the warning about self-closing-tag syntax (#75)
1 parent 664592e commit a555f57

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

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

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2889,13 +2889,8 @@ public final void startTag(ElementName elementName,
28892889
} else if (wasSelfClosing && voidElement
28902890
&& tokenizer.getErrorProfile() != null
28912891
&& tokenizer.getErrorProfile().get("html-strict") != null) {
2892-
warn("Self-closing tag syntax in text/html documents is widely"
2893-
+ " discouraged; it’s unnecessary and interacts badly"
2894-
+ " with other HTML features (e.g., unquoted attribute"
2895-
+ " values). If you’re using a tool that injects"
2896-
+ " self-closing tag syntax into all void elements,"
2897-
+ " without any option to prevent it from doing so,"
2898-
+ " then consider switching to a different tool.");
2892+
warn("Trailing slash on void elements has no effect and interacts"
2893+
+ " badly with unquoted attribute values.");
28992894
// ]NOCPP]
29002895
}
29012896
// CPPONLY: if (mBuilder == null && attributes != HtmlAttributes.EMPTY_ATTRIBUTES) {

0 commit comments

Comments
 (0)