1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-28 17:39:57 +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.
if (
(startOffset == 0) &&
(startText == startInline || startInline.getOffset(startText.key) == 0)
(startBlock.text != '') &&
(!startInline || startInline.getOffset(startText.key) == 0)
) {
after = selection.collapseToStartOf(startText)
}