From c341664765b96ad02105c27eaccab812d417a4a5 Mon Sep 17 00:00:00 2001 From: Kuitos Date: Tue, 26 Dec 2023 19:27:50 +0800 Subject: [PATCH] fix: double quote link element href as selector (#2865) * fix: double quote link element href as selector * Create giant-geckos-love.md --- .changeset/giant-geckos-love.md | 5 +++++ .../sandbox/src/patchers/dynamicAppend/forStandardSandbox.ts | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/giant-geckos-love.md diff --git a/.changeset/giant-geckos-love.md b/.changeset/giant-geckos-love.md new file mode 100644 index 000000000..0cb448c21 --- /dev/null +++ b/.changeset/giant-geckos-love.md @@ -0,0 +1,5 @@ +--- +"@qiankunjs/sandbox": patch +--- + +fix: double quote link element href as selector diff --git a/packages/sandbox/src/patchers/dynamicAppend/forStandardSandbox.ts b/packages/sandbox/src/patchers/dynamicAppend/forStandardSandbox.ts index 4175c8c67..ad12e167b 100644 --- a/packages/sandbox/src/patchers/dynamicAppend/forStandardSandbox.ts +++ b/packages/sandbox/src/patchers/dynamicAppend/forStandardSandbox.ts @@ -357,7 +357,7 @@ export function patchStandardSandbox( const isElementExisted = (element: HTMLStyleElement | HTMLLinkElement) => { if (container.contains(element)) return true; if ('rel' in element && element.rel === 'stylesheet' && element.href) - return !!container.querySelector(`link[rel=stylesheet][href=${element.href}]`); + return !!container.querySelector(`link[rel=stylesheet][href="${element.href}"]`); return false; };