draft-js-utils icon indicating copy to clipboard operation
draft-js-utils copied to clipboard

Convert to raw to HTML conversion

Open katpas opened this issue 8 years ago • 2 comments

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)?

katpas avatar Oct 11 '17 18:10 katpas

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.

sstur avatar Oct 16 '17 12:10 sstur

Ok thanks!

katpas avatar Oct 16 '17 12:10 katpas