provide useful feedback on encountering void element closing tag

pull/225/head
Rich-Harris 9 years ago
parent 5801df8a25
commit fc977a2abe

@ -47,6 +47,10 @@ export default function tag ( parser ) {
parser.allowWhitespace();
if ( isClosingTag ) {
if ( voidElementNames.test( name ) ) {
parser.error( `<${name}> is a void element and cannot have children, or a closing tag`, start );
}
if ( !parser.eat( '>' ) ) parser.error( `Expected '>'` );
const element = parser.current();

@ -0,0 +1,8 @@
{
"message": "<input> is a void element and cannot have children, or a closing tag",
"loc": {
"line": 1,
"column": 23
},
"pos": 23
}

@ -0,0 +1 @@
<input>this is illegal!</input>
Loading…
Cancel
Save