feat(HTML Editor): add raw html editor

Allow to copy raw html or paste it from clipboard
Fix #1581
This commit is contained in:
ShareVB committed 2025-07-06 18:43:55 +02:00
1 parent 700cc2a196
commit d625f622ca
2 files changed
+18

No files matched your search

@@ -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(() => {
@@ -24,6 +24,18 @@ const formattedHtml = computed(() => {
</script>
<template>
<details>
<summary>Click here to paste or edit raw html</summary>
<c-input-text
v-model:value="html"
multiline raw-text
placeholder="Your Html content..."
rows="8"
autofocus
label="Your Html to convert (can paste from clipboard):"
paste-html
/>
</details>
<Editor v-model:html="html" />
<NSpace justify="center">
<n-form-item label="Minify:" label-placement="left" mt-2>