Skip to content

Commit 82d4913

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 20eaf92 commit 82d4913

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
@@ -1567,7 +1567,7 @@ public final void eof() throws SAXException {
15671567
break eofloop;
15681568
}
15691569
if (errorHandler != null) {
1570-
errUnclosedElements(eltPos, "template");
1570+
errListUnclosedStartTags(0);
15711571
}
15721572
while (currentPtr >= eltPos) {
15731573
pop();

0 commit comments

Comments
 (0)