diff --git a/src/plugins/core.js b/src/plugins/core.js index 361f0826e..269765b59 100644 --- a/src/plugins/core.js +++ b/src/plugins/core.js @@ -371,11 +371,12 @@ function Plugin(options = {}) { function onKeyDownEnter(e, data, state) { debug('onKeyDownEnter', { data }) - const { document, startKey, startBlock } = state + const { document, startKey } = state + const hasVoidParent = document.hasVoidParent(startKey) - // For void blocks, we don't want to split. Instead we just move to the - // start of the next text node if one exists. - if (startBlock && startBlock.isVoid) { + // For void nodes, we don't want to split. Instead we just move to the start + // of the next text node if one exists. + if (hasVoidParent) { const text = document.getNextText(startKey) if (!text) return return state