A concern with hooking into the parsing for pasted content is that it’s a rather subtle process, partially driven by the context into which you’re pasting. Though I guess in simpler schemas in most situations you would get an okay result even if you ignore that.
I’m also kind of worried about the proliferation of props around clipboard handling. We’re probably not really hitting the right abstraction there yet. A ‘fully reimplement it yourself’ prop handlePaste(view, clipboardHTML, clipboardText) → bool might be a good stopgap for supporting custom behavior without digging us even further into a poor framing. Would that work for you?
Yes, definitely. It looks like I’ll need something like it myself, too.
That almost works, but you can no longer tell the difference between single and multiple newlines at that point, so it would go wrong for things like line-wrapped markdown or tight lists.
This patch adds handleDrop and handlePaste events which can be used to do something like this. It’ll be part of 0.20.0, to be released early next week (or, if I’m ridiculously fast today, tonight).