How can I delete a selection normally? In my editor I have regular nodes (paragraph, text, blockquotes, etc). I also have a custom node. I had to overwrite the default backspace command to handle deleting the custom nodes. I was successful, but now I am wondering how to delete the non-custom nodes in a default manner.
doc.nodesBetween(start, end, (node, pos) => {
if (node.type.name === CustomNode.name) {
tr.replace // delete
tr.replaceWith // modify
}
});
The question is how can I implement a prosemirror-default delete for nodes which are not my CustomNode? In the example, having a selection from the 2nd A, the custom node, to the 1st B.
<p>AA*A<custom-node1>...</custom-node1>B*BB</p>