Parsing HTML back to Slate format? #289
-
I'm saving text generated on the editor as HTML to a DB using: When I load the content again I will need to parse the HTML back to Slate format. What's the right way to do that? I've tried a couple fns like Would love some help. Thanks! 🙏 |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
From our sandbox, can you try:
|
Beta Was this translation helpful? Give feedback.
-
Thank you so much!! Life saver. |
Beta Was this translation helpful? Give feedback.
-
From 0.67.x, the function supports HTML string: const nodes = deserializeHTMLToDocumentFragment({
plugins,
element: '<p>Deserialized paragraph here.</p>',
})
const html = serializeHTMLFromNodes({
plugins,
nodes,
}) |
Beta Was this translation helpful? Give feedback.
From 0.67.x, the function supports HTML string: