Skip to content

High performance, self-hosted, newsletter and mailing list manager with a modern dashboard. Single binary app.

Fix Go tpl expressions breaking in Visual editor HTML.

Kailash Nadhd4007d5148ea
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 });
},
});
}