From 9bee9a2ac0279ef4965d203e3517bb91edc784aa Mon Sep 17 00:00:00 2001 From: fi3ework Date: Thu, 17 Feb 2022 01:15:18 +0800 Subject: [PATCH] fix: should not parse JSON-LD script in head (fix #538) --- src/node/build/render.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/node/build/render.ts b/src/node/build/render.ts index e5e226e3..7c424687 100644 --- a/src/node/build/render.ts +++ b/src/node/build/render.ts @@ -182,7 +182,7 @@ function renderHead(head: HeadConfig[]): Promise { head.map(async ([tag, attrs = {}, innerHTML = '']) => { const openTag = `<${tag}${renderAttrs(attrs)}>` if (tag !== 'link' && tag !== 'meta') { - if (tag === 'script') { + if (tag === 'script' && attrs.type !== 'application/ld+json') { innerHTML = ( await transformWithEsbuild(innerHTML, 'inline-script.js', { minify: true