Something like
if (typeof contentElement == "function") {
contentDOM = contentElement(dom)
}
could be very useful in cases where the contentElement cannot be “selected” trivially. It’s a one-line change in prosemirror-model/from_dom.js. Is this an acceptable request, does it need more arguments ?