Open jan0991 opened 5 years ago
Current fix for HTML to DraftJS conversion is sadly not good enough :(
I am not able to think of a good solution for you atm, you can play around with the code of html-to-draftjs
for this.
I'm also on this.
I think htmlToDraft() function makes the html tag's being converted magic. Did you, @jan0991 find out some imaginative solution to get it working?
I'm playing with this libs at the moment, with no luck.
import { stateToHTML } from 'draft-js-export-html';
import { stateFromHTML } from 'draft-js-import-html';
Thank you.
Solved -> https://github.com/jpuri/react-draft-wysiwyg/issues/772#issuecomment-460251352
I need to be able to toggle HTML editor, so I used the solution provided by @NukaPunk here: https://github.com/jpuri/react-draft-wysiwyg/issues/315#issuecomment-439028260
The only issue is that if I try to use
<div>...</div>
in HTML mode it just deletes it or converts to<span>
or<p>..
I also can't add class names or styles.What could be causing this? Any other way to get a properly working HTML editor?
Thanks!