Merge pull request #255 from msteitle/dontThrowParseErrorOnDoctypeDeclaration

Dont throw parse error on doctype declaration
pull/265/head
Rich Harris 8 years ago committed by GitHub
commit 9a2b8275f8

@ -6,7 +6,7 @@ import { trimStart, trimEnd } from '../utils/trim.js';
import { decodeCharacterReferences } from '../utils/html.js'; import { decodeCharacterReferences } from '../utils/html.js';
import voidElementNames from '../../utils/voidElementNames.js'; import voidElementNames from '../../utils/voidElementNames.js';
const validTagName = /^[a-zA-Z]{1,}:?[a-zA-Z0-9\-]*/; const validTagName = /^\!?[a-zA-Z]{1,}:?[a-zA-Z0-9\-]*/;
const invalidUnquotedAttributeCharacters = /[\s"'=<>\/`]/; const invalidUnquotedAttributeCharacters = /[\s"'=<>\/`]/;
const specials = { const specials = {

@ -1 +1 @@
export default /^(?:area|base|br|col|command|doctype|embed|hr|img|input|keygen|link|meta|param|source|track|wbr)$/; export default /^(?:area|base|br|col|command|\!doctype|embed|hr|img|input|keygen|link|meta|param|source|track|wbr)$/;

@ -0,0 +1,23 @@
{
"html": {
"start": 0,
"end": 15,
"type": "Fragment",
"children": [{
"attributes": [{
"end": 14,
"name": "html",
"start": 10,
"type": "Attribute",
"value": true
}],
"children": [],
"end": 15,
"name": "!doctype",
"start": 0,
"type": "Element"
}]
},
"css": null,
"js": null
}
Loading…
Cancel
Save