diff --git a/src/commands.js b/src/commands.js index 82f11a5..1114ece 100644 --- a/src/commands.js +++ b/src/commands.js @@ -36,7 +36,7 @@ export function joinBackward(state, dispatch, view) { let before = $cut.nodeBefore // Apply the joining algorithm - if (!before.type.spec.isolating && deleteBarrier(state, $cut, dispatch)) + if (!before.type.spec.isolating && !before.type.spec.keepAdjacent && deleteBarrier(state, $cut, dispatch)) return true // If the node below has no content and the node above is @@ -118,7 +118,7 @@ export function joinForward(state, dispatch, view) { let after = $cut.nodeAfter // Try the joining algorithm - if (deleteBarrier(state, $cut, dispatch)) return true + if (!after.type.spec.keepAdjacent && deleteBarrier(state, $cut, dispatch)) return true // If the node above has no content and the node below is // selectable, delete the node above and select the one below.