Replies: 1 comment 1 reply
-
|
Beta Was this translation helpful? Give feedback.
1 reply
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.
-
I am currently trying Lexical to implement a rich text editor. With the help of Lexical docs and other tutorials, I am able to create quite a good text editor. Still, the problem is I am just able to make the rich text editor where I can play with all the styles and formatting but I am not being able to get that formatted rich text from the text editor.
For eg: I can get the plain text using the below code:
console.log(root.getTextContent());But how can I get the rich text HTML from Lexical Text Editor? For eg: if there is bold text and italic text in the text editor, I want to get something like the below so that I can use that elsewhere.
Output:
<p><strong>Bold text here</strong></p>I searched the documentation and basically the whole internet but I couldn't find any. It could be that I am missing something because I'm comparatively new but I need help.
If possible, I would like you to help me by showing me the code on how I can do that because that would help me better in understanding what you're trying to say.
Thank you!
Beta Was this translation helpful? Give feedback.
All reactions