better error for unmatched closing tag (#321)

pull/323/head
Rich Harris 8 years ago
parent a8d19839cd
commit 2efd532563

@ -90,6 +90,8 @@ export default function tag ( parser ) {
// close any elements that don't have their own closing tags, e.g. <div><p></div>
while ( parent.name !== name ) {
if ( parent.type !== 'Element' ) parser.error( `</${name}> attempted to close an element that was not open`, start );
parent.end = start;
parser.stack.pop();

@ -0,0 +1,8 @@
{
"message": "</div> attempted to close an element that was not open",
"loc": {
"line": 1,
"column": 0
},
"pos": 0
}
Loading…
Cancel
Save