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

Convert raw HTML containing datasets into a draftJS contentBlock and back again

Open sstur opened this issue 8 years ago • 1 comments

Originally posted here.

The original post by @rpmonteiro is as follows:


We're trying to convert this into a valid contentBlock that draftJS can display (it's a custom entity of type 'PERSON'), and then eventually do the opposite with the export-html.

<p>This is a <span class="person" id="123" data-tag-id="100">special</span> element.</p>

How would we go about this? Is it possible using this library? We can't seem to hook any kind of data attributes when doing stateFromElement passing customBlockFn() in the options.

Thank you!

sstur avatar Sep 03 '17 16:09 sstur

@rpmonteiro: we're working on a solution for this which is tracked here.

sstur avatar Sep 05 '17 07:09 sstur