draft-js-utils
draft-js-utils copied to clipboard
Convert to raw to HTML conversion
So right now I can convert the content state from the editor into html using the module below
import {stateToHTML} from 'draft-js-export-html';
let html = stateToHTML(contentState);
We're looking to take the output of convertFromRaw(contentState) which is saved into our database and then to turn this into html on the backend so we can send it as the body of an email.
Have you got any plans for rawToHTML(rawContent)?
For the time being, you will need to convert the raw (JSON-style structure) to an actual contentState (ImmutableJS-style structure) in order for stateToHTML to work.
I think it would take some serious refactoring to make this work with the raw data, so I don't have plans for that currently.
Ok thanks!