Skip to content

Commit 908b24c

Browse files
committed
Remove support for non-HTML doctypes
Related to syntax-tree/[email protected]
1 parent b1dfbcc commit 908b24c

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

lib/index.js

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
/**
22
* @typedef {import('parse5').Document} P5Document
33
* @typedef {import('parse5').DocumentFragment} P5Fragment
4-
* @typedef {import('parse5').DocumentType} P5Doctype
54
* @typedef {import('parse5').Element} P5Element
65
* @typedef {import('parse5').Attribute} P5Attribute
76
* @typedef {import('parse5').Location} P5Location
@@ -267,16 +266,13 @@ export function raw(tree, file, options) {
267266
* @returns {void}
268267
*/
269268
function doctype(node) {
270-
/** @type {P5Doctype} */
271-
// @ts-ignore it’s a doctype.
272-
var p5 = toParse5(node)
273269
resetTokenizer()
274270
parser._processToken({
275271
type: doctypeToken,
276-
name: p5.name,
272+
name: 'html',
277273
forceQuirks: false,
278-
publicId: p5.publicId,
279-
systemId: p5.systemId,
274+
publicId: '',
275+
systemId: '',
280276
location: createParse5Location(node)
281277
})
282278
}

0 commit comments

Comments
 (0)