From d7bfb144ba1718d14664ec755adf6e2281a4ab71 Mon Sep 17 00:00:00 2001 From: Daniel Date: Mon, 10 Oct 2022 15:02:20 +0200 Subject: [PATCH] fixing multiple doctype injections in single file (#5035) * fixing multiple doctype injections in single file * adding changeset Co-authored-by: C5341616 --- .changeset/chilly-carrots-think.md | 5 +++++ packages/astro/src/runtime/server/render/page.ts | 1 + 2 files changed, 6 insertions(+) create mode 100644 .changeset/chilly-carrots-think.md diff --git a/.changeset/chilly-carrots-think.md b/.changeset/chilly-carrots-think.md new file mode 100644 index 000000000..a90ab8715 --- /dev/null +++ b/.changeset/chilly-carrots-think.md @@ -0,0 +1,5 @@ +--- +'astro': patch +--- + +preventing multiple doctype injection into html documents diff --git a/packages/astro/src/runtime/server/render/page.ts b/packages/astro/src/runtime/server/render/page.ts index 7562c8563..70445ee41 100644 --- a/packages/astro/src/runtime/server/render/page.ts +++ b/packages/astro/src/runtime/server/render/page.ts @@ -30,6 +30,7 @@ async function iterableToHTMLBytes( for await (const chunk of iterable) { if (isHTMLString(chunk)) { if (i === 0) { + i++; if (!/\n', result); if (onDocTypeInjection) {