How can I pass in existing html content to initialize an instance of the editor? #3195
Unanswered
tolkienfan2
asked this question in
Q&A
Replies: 1 comment
-
I'm not sure what this means - have you tried it? If so, where does it fail? I would expect it to work. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
When using LexicalComposer, the initialConfig accepts an editorState parameter that can be used to pass in some initial content. If this initialContent is a complex html string, I am not clear how to parse it. For a simple string, I have it like below (everything works fine here):
Which I then pass in to LexicalComposer. If the string I pass in is NOT a simple string, but rather some html content in the form of a string, and if I do NOT know ahead of time exactly what will be passed in (i.e. I want to parse existing html content created elsewhere) how do I do it? I can't use $generateNodesFromDOM because my editor hasn't yet been initialized.
Beta Was this translation helpful? Give feedback.
All reactions