From d625f622caa637820915d4ee29f908c80df423a7 Mon Sep 17 00:00:00 2001 From: ShareVB Date: Sun, 6 Jul 2025 18:43:55 +0200 Subject: [PATCH] feat(HTML Editor): add raw html editor Allow to copy raw html or paste it from clipboard Fix #1581 --- src/tools/html-wysiwyg-editor/editor/editor.vue | 6 ++++++ .../html-wysiwyg-editor/html-wysiwyg-editor.vue | 12 ++++++++++++ 2 files changed, 18 insertions(+) diff --git a/src/tools/html-wysiwyg-editor/editor/editor.vue b/src/tools/html-wysiwyg-editor/editor/editor.vue index bbe1799e..b4a9d0d7 100644 --- a/src/tools/html-wysiwyg-editor/editor/editor.vue +++ b/src/tools/html-wysiwyg-editor/editor/editor.vue @@ -33,6 +33,12 @@ const editor = new Editor({ ], }); +watch(html, (newHtml) => { + if (editor.getHTML() !== newHtml) { + editor.commands.setContent(newHtml); + } +}); + editor.on('update', ({ editor }) => emit('update:html', editor.getHTML())); tryOnBeforeUnmount(() => { diff --git a/src/tools/html-wysiwyg-editor/html-wysiwyg-editor.vue b/src/tools/html-wysiwyg-editor/html-wysiwyg-editor.vue index 06e266cd..998dceef 100644 --- a/src/tools/html-wysiwyg-editor/html-wysiwyg-editor.vue +++ b/src/tools/html-wysiwyg-editor/html-wysiwyg-editor.vue @@ -24,6 +24,18 @@ const formattedHtml = computed(() => {