Skip to content

Commit 31ba78f

Browse files
Correct error for EOF in “in template” state
Doing `errUnclosedElements(eltPos, "template")` for EOF in the “in template” state results in the error message “End tag `template` seen, but there were open elements”, which is all wrong because the actual problem is that though a `template` end tag was expected, EOF was reached without a `template` end tag being seen. So let’s instead when we reach this just report the list of open elements.
1 parent c22c3fa commit 31ba78f

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
@@ -1351,7 +1351,7 @@ public final void eof() throws SAXException {
13511351
break eofloop;
13521352
}
13531353
if (errorHandler != null) {
1354-
errUnclosedElements(eltPos, "template");
1354+
errListUnclosedStartTags(0);
13551355
}
13561356
while (currentPtr >= eltPos) {
13571357
pop();

0 commit comments

Comments
 (0)