Fix Go tpl expressions breaking in Visual editor HTML.

Closes #2593.
Closes #2499.
This commit is contained in:
Kailash Nadh 2025-09-09 22:08:43 +05:30
parent deb41f8d1c
commit d4007d5148

View file

@ -65,7 +65,9 @@ export default {
iframe.contentWindow.EmailBuilder.render('visual-editor-container', { iframe.contentWindow.EmailBuilder.render('visual-editor-container', {
data: {}, data: {},
onChange: (data, body) => { 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 });
}, },
}); });
} }