mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
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.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user