1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-07-31 20:40:19 +02:00

Use ByKey instead of NodeOperation in wrapBlockAtRange

This commit is contained in:
Samy Pessé
2016-10-24 12:56:29 +02:00
parent c7f0c655ab
commit b122a2a464

View File

@@ -802,11 +802,7 @@ export function wrapBlockAtRange(transform, range, block) {
}
// inject the new block node into the parent
if (parent != document) {
transform.insertNodeByKey(parent.key, index, block)
} else {
transform.insertNodeOperation([], index, block)
}
transform.insertNodeByKey(parent.key, index, block)
// move the sibling nodes into the new block node
siblings.forEach((node, i) => {