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

convertFromHtml ignores colors

Open MarcelMitzkus opened this issue 7 years ago • 6 comments

Hello,

when using the method convertFromHtml the color is ignored. Example: <p><span style="color: rgb(226,80,65);"><del><strong>asasdsad</strong></del></span></p>

The whole formatting is correct, only the color is missing.

MarcelMitzkus avatar Jun 28 '19 09:06 MarcelMitzkus

I am struggling with this issue too. Is there a way to handle it? I guess every style passed as style html attribute will be ignored. Do you guys have any plans to support it? I will highly appreciate if you give us an idea to workaround it.

kamenminkovcom avatar Jul 05 '19 14:07 kamenminkovcom

I am struggling with this issue too. Is there a way to handle it? I guess every style passed as style html attribute will be ignored. Do you guys have any plans to support it? I will highly appreciate if you give us an idea to workaround it.

Hey,

i solved it by using a different module. Here's what im using now: 'html-to-draftjs';

My react import: import htmlToDraft from 'html-to-draftjs';

I hope this helps you.

MarcelMitzkus avatar Jul 07 '19 18:07 MarcelMitzkus

Good question. I found the code here useful: https://blog.learningdollars.com/2020/04/01/how-to-add-a-rich-text-editor-in-your-react-app-using-draft-js-and-react-draft-wysiwyg/

gpalrepo avatar May 18 '21 19:05 gpalrepo

I am facing the same issue too any workarounds?

Amr3zzat avatar Jun 10 '21 10:06 Amr3zzat

I found a workaround, see here I hope it will help anyone who face this problem

ronenl avatar Jan 20 '22 10:01 ronenl

go to this link https://blog.ldtalentwork.com/2020/04/01/how-to-add-a-rich-text-editor-in-your-react-app-using-draft-js-and-react-draft-wysiwyg/

dilpreet1999 avatar Jul 20 '22 09:07 dilpreet1999