News for hackers. Stuff that matters.
Re:Lexical – a web text editor framework that powers Facebook by jacobsimon on Monday June 20, 2022 @04:08PM (#31815158)
Hey on my business’s website we currently use draft.js for our user discussion product and we convert the user input to markdown for storing in our db. How hard would it be to switch to Lexical and does it support rendering from markdown syntax? Do you recommend any other approaches for safe storage and rendering of rich text? Thanks!
Re:Lexical – a web text editor framework that powers Facebook by acywatson on Monday June 20, 2022 @04:13PM (#31815250)
I work at Meta on the Lexical team - yes, Lexical supports markdown and rendering from markdown syntax. Lexical isn't a drop-in replacement for Draft, but we're migrating all of our surfaces internally and it isn't particularly difficult, especially if you aren't storing in the DraftJS-specific format. As for alternatives, you can also consider storing it as JSON, which Lexical supports.
Re:Lexical – a web text editor framework that powers Facebook by trueadm on Monday June 20, 2022 @04:11PM (#31815222)
Lexical has markdown support via `@lexical/markdown`. See https://lexical.dev/docs/api/lexical-markdown.