The desired behavior is, when pressing backspace inside the empty container child of a split, the split should be replaced by the plain series of blocks. However the schema forces splits to always have two container children. I can just lift the schema restriction by letting split accept one or two children, and append a replacing transaction for every single child split, but I am wondering if there will be a better workaround for this.
Sorry if the question is not clear enough(English is not my first language), and thanks in advance.
If by ‘the best practice’ you mean how this is done, you’d call tr.step(new ReplaceAroundStep(...)), and make sure you get all the (rather finicky) parameter to the constructor right so that the slice and the gap produce a valid new document.
In case anyone reads this later, I decided to handle it in EditorView’s dispatchTransaction, which is quite trivial but wasn’t easy to figure it out as a ProseMirror novice.