improve clearNodes command

This commit is contained in:
Philipp Kühn
2021-01-29 08:56:52 +01:00
parent 4b4ec7d766
commit 72ff2d212e

View File

@@ -18,7 +18,7 @@ export const clearNodes = (): Command => ({ state, tr, dispatch }) => {
const targetLiftDepth = liftTarget(nodeRange)
if (node.type.isTextblock && dispatch) {
tr.setNodeMarkup(nodeRange.start, state.schema.nodes.paragraph)
tr.setNodeMarkup(nodeRange.start, state.doc.type.contentMatch.defaultType)
}
if ((targetLiftDepth || targetLiftDepth === 0) && dispatch) {