Skip to content

Reloading state from HTML with colors? #120

@sontek

Description

@sontek

I added a color picker to my toolbar, had it change the color and stored it as HTML.

import draftToHtml from 'draftjs-to-html';
const html = draftToHtml(draftState);

Now I want to edit the content again so I use:

import {stateFromHTML} from 'draft-js-import-html';
stateFromHTML(html);

The HTML I have is:

<p>Given <span style="color: #2a00ff;"><strong>Name</strong></span></p>

after I load the HTML back in I no longer have the color.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions