mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-29 09:59:48 +02:00
fix logic for empty blocks
This commit is contained in:
@@ -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)
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user