From f3f542b42f48fa88229b245332ecaa55c349e1b0 Mon Sep 17 00:00:00 2001 From: James Date: Wed, 6 May 2026 05:04:43 +0000 Subject: [PATCH] test(bundler): accept arbitrary content in script close tag MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit CodeQL still flagged `` as too narrow — the rule wants tolerance for `` (HTML parser treats trailing content in a close tag as part of the tag). Switched to `]*>` for full coverage. The bundler still always emits the canonical ``; this is test-side hardening, not a runtime fix. --- packages/core/src/compiler/htmlBundler.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/core/src/compiler/htmlBundler.test.ts b/packages/core/src/compiler/htmlBundler.test.ts index 7675b307f..c70f49037 100644 --- a/packages/core/src/compiler/htmlBundler.test.ts +++ b/packages/core/src/compiler/htmlBundler.test.ts @@ -107,7 +107,7 @@ describe("bundleToSingleHtml", () => { // the separator, parse would fail with an unexpected-token error somewhere // around the chunk boundary. const { transformSync } = await import("esbuild"); - const re = /]*>([\s\S]*?)<\/script\s*>/gi; + const re = /]*>([\s\S]*?)<\/script[^>]*>/gi; let m: RegExpExecArray | null; while ((m = re.exec(bundled)) !== null) { const body = m[1];