diff --git a/packages/js/src/features/blocks/logic/script/executeScript.ts b/packages/js/src/features/blocks/logic/script/executeScript.ts index 36342cec16..ee8c4cccb0 100644 --- a/packages/js/src/features/blocks/logic/script/executeScript.ts +++ b/packages/js/src/features/blocks/logic/script/executeScript.ts @@ -1,10 +1,17 @@ import type { ScriptToExecute } from 'models' export const executeScript = async ({ content, args }: ScriptToExecute) => { - const func = Function(...args.map((arg) => arg.id), content) + const func = Function(...args.map((arg) => arg.id), parseContent(content)) try { await func(...args.map((arg) => arg.value)) } catch (err) { console.error(err) } } + +const parseContent = (content: string) => { + const contentWithoutScriptTags = content + .replace(/