From 3c6819fdc40f0c8135ce39e89b993496fabd43f6 Mon Sep 17 00:00:00 2001 From: Ian Storm Taylor Date: Fri, 18 Nov 2016 11:33:40 -0800 Subject: [PATCH] fix logic for empty blocks --- src/transforms/at-current-range.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/transforms/at-current-range.js b/src/transforms/at-current-range.js index 8d593929c..adb130ac3 100644 --- a/src/transforms/at-current-range.js +++ b/src/transforms/at-current-range.js @@ -323,7 +323,8 @@ export function splitBlock(transform, depth = 1) { // block, the starting text node won't need to be split. if ( (startOffset == 0) && - (startText == startInline || startInline.getOffset(startText.key) == 0) + (startBlock.text != '') && + (!startInline || startInline.getOffset(startText.key) == 0) ) { after = selection.collapseToStartOf(startText) }