3

I am starting with Draft.js right now, so I might miss some important things here. But as the title says: I would like to get the full html generated by the editor. Right now I have:

this.state.editor.getCurrentContent() // Object ContentState
this.state.editor.getCurrentContent().getPlainText() // no html tags

1 Answer 1

2

First of say, draftjs is not designed for HTML editing, although it use HTML to rendering the editor. For now there is no any perfect solution to export the ContentState to HTML.

The draft-js-export-html may help a lot if you not do much customization to draftjs blocks.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks, that does the trick so far… The current Application I am on is a bit wired, serverside rendering would be the best solution, but, well, this can probably happen in the far future… Maybe I have to use another Editor, but for now, that is perfect!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.