Update serialize-doctype.ts

This commit is contained in:
Jun 2022-02-24 21:06:32 -08:00 committed by GitHub
parent 2b80597541
commit 50d61960c2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -30,8 +30,8 @@ const createDocType = (ignored: string, doctype?: DocumentType | null): string =
const name = htmlEscape(doctype.name);
const internalSubset = htmlEscape(doctype.internalSubset);
const publicId = `"${htmlEscape(doctype.publicId)}"`;
const systemId = `"${htmlEscape(doctype.systemId)}"`;
const publicId = doctype.publicId ? `"${htmlEscape(doctype.publicId)}"` : '';
const systemId = doctype.systemId ? `"${htmlEscape(doctype.systemId)}"` : '';
return `<!DOCTYPE ${name}${internalSubset}${publicId}${systemId}><html></html>`;
}