I can't find a way to extract custom attributes (like data-*) and tags when you paste a HTML content.
Am I missing something from the docs?
@fmatoss you can use handlePastedText function.
handlePastedText( pastedText ) {
// pastedText is string and you can strip out from there..
}
The problem happens when I use convertFromHTML and change the editorState, if I paste
<p data-something="1">Text</p>
the draft-js-export-html output will be
<p>Text</p>
I need to export to HTML because I am trying to replace a legacy editor with Draft, to maintain compatibility.
Does Draft save custom attributes and tags inside it's data structure? If yes, then this is a draft-js-export-html issue.
Most helpful comment
The problem happens when I use
convertFromHTMLand change theeditorState, if I pastethe
draft-js-export-htmloutput will beI need to export to HTML because I am trying to replace a legacy editor with Draft, to maintain compatibility.
Does Draft save custom attributes and tags inside it's data structure? If yes, then this is a
draft-js-export-htmlissue.