Convert a DOM DocumentType into a string, e.g. "<!DOCTYPE html>"
Browse Source

Remove internalSubset support.

It seems unsupported in any modern browser, and absent from current DOM specs.
tags/v0.1.0
Gerben 6 years ago
parent
commit
5ca0aa61c9
2 changed files with 0 additions and 11 deletions
  1. +0
    -1
      index.js
  2. +0
    -10
      index.test.js

+ 0
- 1
index.js View File

@@ -7,7 +7,6 @@ export default function doctypeToString(doctype) {
+ (doctype.systemId
? (doctype.publicId ? `` : ` SYSTEM`) + ` "${doctype.systemId}"`
: ``)
+ (doctype.internalSubset ? ` [${doctype.internalSubset}]` : ``)
+ `>`
return doctypeString
}

+ 0
- 10
index.test.js View File

@@ -36,13 +36,3 @@ test('should work for a doctype without public id', t => {
const doc = makeStubDocument(doctype)
t.is(doctypeToString(doc.doctype), doctype)
})

// Cannot test, as modern parsers do not to support internal declarations.
// test('should work for a doctype with internal declarations', t => {
// const doctype = `<!DOCTYPE html SYSTEM "example.dtd" [
// <!ENTITY foo "foo">
// <!ENTITY bar "bar">
// ]>`
// const doc = makeStubDocument(doctype)
// t.is(doctypeToString(doc.doctype), doctype)
// })

Loading…
Cancel
Save