We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents a8d1983 + 2efd532 commit 0da2a99Copy full SHA for 0da2a99
src/parse/state/tag.js
@@ -90,6 +90,8 @@ export default function tag ( parser ) {
90
91
// close any elements that don't have their own closing tags, e.g. <div><p></div>
92
while ( parent.name !== name ) {
93
+ if ( parent.type !== 'Element' ) parser.error( `</${name}> attempted to close an element that was not open`, start );
94
+
95
parent.end = start;
96
parser.stack.pop();
97
test/parser/error-unmatched-closing-tag/error.json
@@ -0,0 +1,8 @@
1
+{
2
+ "message": "</div> attempted to close an element that was not open",
3
+ "loc": {
4
+ "line": 1,
5
+ "column": 0
6
+ },
7
+ "pos": 0
8
+}
test/parser/error-unmatched-closing-tag/input.html
@@ -0,0 +1 @@
+</div>
0 commit comments