Replies: 4 comments
-
Currently working on the same thing. Retrieving the HTML is easy. But setting the editor content from some HTML is quite hard. |
Beta Was this translation helpful? Give feedback.
-
HTML is a supported format of default value. |
Beta Was this translation helpful? Give feedback.
-
But there is no html insert equivalent of replaceAll ? |
Beta Was this translation helpful? Give feedback.
-
I've managed to make the editor convert my html to markdown like this: // pagetoedit is just a object that I stored with html
const dom = new DOMParser().parseFromString(pagetoedit.html, 'text/html');
Editor.make()
.config((ctx) => {
ctx.set(rootCtx, document.getElementById('editor'));
ctx.set(defaultValueCtx, { type: 'html', dom: dom.firstElementChild });
})
.use(commonmark)
.create() |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I will save the html,when I want to edit it,can I insert it to editor ?
Beta Was this translation helpful? Give feedback.
All reactions