Skip to content

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

Fix incorrect WYSIWYG image insertion position

Kailash Nadh3e755596c727
diff --git a/frontend/src/components/Editor.vue b/frontend/src/components/Editor.vue
index 4187fdbb..efcda328 100644
--- a/frontend/src/components/Editor.vue
+++ b/frontend/src/components/Editor.vue
@@ -193,7 +193,11 @@ export default {
},
onMediaSelect(m) {
- this.$refs.quill.quill.insertEmbed(10, 'image', m.url);
+ const sel = this.$refs.quill.quill.getSelection();
+ if (!sel) {
+ return;
+ }
+ this.$refs.quill.quill.insertEmbed(sel.index, 'image', m.url);
},
},