How can I change this paste-behaviour? I have tried using transformPastedHTML, but I have no idea how to reliably detect where to add a space in the pasted HTML.
transformPastedHTML seems like a reasonable place to do this, or maybe transformPasted. Adding spaces at the start of every block element that isn’t the first would possibly be a good approach.
I discoverd that when multiparagraphed html/text is pasted into an editor with a schema that has only 1 node-type (‘doc’ with content ‘text*’), all the pasted nodes have the name ‘doc’. When I paste in an editor with paragraph support, all pasted nodes are recognised as ‘paragraph’. As I use both types in my application, I conditionally check the node name and only add a space before all but the first one.
Is this the right way to handle this? It does work, but I don’t know what else it could possibly break.