1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-29 01:50:06 +02:00

fix logic for empty blocks

This commit is contained in:
Ian Storm Taylor
2016-11-18 11:33:40 -08:00
parent 7567be2210
commit 3c6819fdc4

View File

@@ -323,7 +323,8 @@ export function splitBlock(transform, depth = 1) {
// block, the starting text node won't need to be split. // block, the starting text node won't need to be split.
if ( if (
(startOffset == 0) && (startOffset == 0) &&
(startText == startInline || startInline.getOffset(startText.key) == 0) (startBlock.text != '') &&
(!startInline || startInline.getOffset(startText.key) == 0)
) { ) {
after = selection.collapseToStartOf(startText) after = selection.collapseToStartOf(startText)
} }