While looking at #323, I also noticed that the error message was "wrong" (inaccurate), so I fixed it and added a test case for it. Previously, the "void elements cannot have end tags" only work if this happens in the root context.
This is the minimal diff to pass the test. Open to suggestions to make it more elegant.
Input:
<div>
<input></input>
</div>
Before:
Closing tag `input` (on line 2) did not match last open tag `div` (on line 1).
After:
Invalid end tag `input` (on line 2) (void elements cannot have end tags).
While looking at #323, I also noticed that the error message was "wrong" (inaccurate), so I fixed it and added a test case for it. Previously, the "void elements cannot have end tags" only work if this happens in the root context.
This is the minimal diff to pass the test. Open to suggestions to make it more elegant.
Input:
Before:
After: