Skip to content

Commit a6b35f4

Browse files
committed
Remove support for non-HTML doctypes
Related to syntax-tree/hast@2.4.0
1 parent 81ec094 commit a6b35f4

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

lib/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,9 @@ function fragment(node, schema) {
8686
function doctype(node) {
8787
return patch(node, {
8888
nodeName: '#documentType',
89-
name: node.name,
90-
publicId: node.public || '',
91-
systemId: node.system || '',
89+
name: 'html',
90+
publicId: '',
91+
systemId: '',
9292
parentNode: undefined
9393
})
9494
}

test/doctype.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@ test('doctype', function (t) {
99
name: 'html',
1010
system: 'http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd'
1111
})
12-
var expected = parse5.parse(
13-
'<!DOCTYPE html SYSTEM "http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd">'
14-
).childNodes[0]
12+
var expected = parse5.parse('<!DOCTYPE html>').childNodes[0]
1513

1614
expected.parentNode = undefined
1715

0 commit comments

Comments
 (0)