You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 6, 2023. It is now read-only.
We have a custom entity which needs to be copy/pasted across editor instances. I think this is related to #166 but my gut tells me the implementation could be different.
From what I see, Draft does not have a generic way of processing entities in pasted HTML and it currently only supports LINK entities being pasted (convertFromHTMLToContentBlocks code)
One option could be to have Draft tag HTML elements with the entity data needed to recreate the entity on paste. This might give a generic way to find entities in pasted HTML. With this, simple configuration could be provided for allowing/denying entities by name or via a filter function (useful for LINK where you want to validate the href).
Another option is to allow me to hook into the Draft paste processor by providing a function to find entities. Sort of similar to option one, but with more DOM traversal.
Final option is that I start building my own paste processor, but I'm certainly not excited about forking ~500 lines of security sensitive code.