Expose more of paste handling internal functions in the API?

I’m using prosemirror in a CMS where developers of new “node types” don’t need to know that much about prosemirror. One just need to return DOM templates.

Anyway, i noticed that inserting properly a DOM node in prosemirror is quite a difficult thing to do. Luckily for me, it’s a problem solved in prosemirror-view internal’s parseFromClipboard function - that part https://github.com/ProseMirror/prosemirror-view/blob/696020015eab900255edfec40c3c8e95a993d005/src/clipboard.js#L62-L71

Exposing that part or making it possible to call it even in an undocumented way would be awesome.

It is possible to call it in an undocumented way (it’s exported as __parseFromClipboard for testing purposes).

But could you describe the problem in a bit more detail? (handlePaste already passes you the parsed slice.)

Well, that’s true… I wasn’t keen on Calling directly parseFromClipboard because it meant converting the DOM node i wanted to parse to html before passing it to parseFromClipboard. Still, it works :slight_smile: