From 4ff5a57de3c9438258d80a2e2fe33c89e9b3ffbf Mon Sep 17 00:00:00 2001 From: Dannon Baker Date: Wed, 1 Apr 2026 11:30:34 -0400 Subject: [PATCH] Add newlines around IIFE-wrapped script content Without the newlines, a webhook script ending in a line comment (// ...) would swallow the closing })(); and produce a SyntaxError. --- client/src/utils/utils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/utils/utils.ts b/client/src/utils/utils.ts index 717208ffe4d..d176c148a27 100644 --- a/client/src/utils/utils.ts +++ b/client/src/utils/utils.ts @@ -275,7 +275,7 @@ export function appendScriptStyle(data: Readonly<{ script?: string; styles?: str if (data.script && data.script !== "") { const tag = document.createElement("script"); tag.type = "text/javascript"; - tag.textContent = `(function(){${data.script}})();`; + tag.textContent = `(function(){\n${data.script}\n})();`; document.head.appendChild(tag); } // create a style tag inside head tag