-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Perisisting / Displaying Draft.js content #62
Comments
We store Notes as a structure similar to the raw output provided by You can also use the I didn't want to release any conversion utilities we weren't using in production on Facebook, so that's why I haven't included any in the repo. I also didn't want to be prescriptive about the HTML or markdown flavors people might want to use. So yes, you'll need to write your own -- my assumption has been that someone would build these utilities soon after launch. :) |
Great, thanks for the info ;) |
A little experimental and just for an simple project need, but feel free to instigate or fork if you need to store HTML in database. |
Thanks @florentferry , I've also knocked up up a demo of HTML in/HTML out editing here based on the Rich example: https://github.com/dburrows/draft-js-BasicHtmlEditor In: Uses |
If anyone comes along with an export to commonmark example, I'd be happy to see that. 😄 |
Great project, exactly what I'm looking for, after playing around I understand how to get a raw js representation of the content from the editorState
Is this Raw state what your are persisting to a DB?
Coupled with that - how are you handling display of the content? Are there any utilities to convert this to a viewable format e.g. HTML? It's fine if the answer is 'you need to write your own parsers for the raw format' but would be good to have some pointers to how best to parse Draft.js raw into other formats?
I guess you must be doing something kind of conversion at FB, but maybe that's a wrong assumption, any guidance would be much appreciated.
The text was updated successfully, but these errors were encountered: