From d4007d5148ea98ad8f272ce4f663cbdce819fbc3 Mon Sep 17 00:00:00 2001 From: Kailash Nadh Date: Tue, 9 Sep 2025 22:08:43 +0530 Subject: [PATCH] Fix Go tpl expressions breaking in Visual editor HTML. Closes #2593. Closes #2499. --- frontend/src/components/VisualEditor.vue | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/frontend/src/components/VisualEditor.vue b/frontend/src/components/VisualEditor.vue index 57b442c7..5228e2d4 100644 --- a/frontend/src/components/VisualEditor.vue +++ b/frontend/src/components/VisualEditor.vue @@ -65,7 +65,9 @@ export default { iframe.contentWindow.EmailBuilder.render('visual-editor-container', { data: {}, onChange: (data, body) => { - this.$emit('change', { source: JSON.stringify(data), body }); + // Hack to fix quotes in Go {{ templating }} in the HTML body. + const tpl = body.replace(/\{\{[^}]*\}\}/g, (match) => match.replace(/"/g, '"')); + this.$emit('change', { source: JSON.stringify(data), body: tpl }); }, }); }