From 50d61960c2dc1c8af08e973f9e90696d53f60cc2 Mon Sep 17 00:00:00 2001 From: Jun Date: Thu, 24 Feb 2022 21:06:32 -0800 Subject: [PATCH] Update serialize-doctype.ts --- src/dom/serialize-doctype.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/dom/serialize-doctype.ts b/src/dom/serialize-doctype.ts index ade0e9e..84c17a8 100644 --- a/src/dom/serialize-doctype.ts +++ b/src/dom/serialize-doctype.ts @@ -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 ``; }