mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-11 01:33:58 +02:00
Use ByKey instead of NodeOperation in wrapBlockAtRange
This commit is contained in:
@@ -802,11 +802,7 @@ export function wrapBlockAtRange(transform, range, block) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// inject the new block node into the parent
|
// inject the new block node into the parent
|
||||||
if (parent != document) {
|
transform.insertNodeByKey(parent.key, index, block)
|
||||||
transform.insertNodeByKey(parent.key, index, block)
|
|
||||||
} else {
|
|
||||||
transform.insertNodeOperation([], index, block)
|
|
||||||
}
|
|
||||||
|
|
||||||
// move the sibling nodes into the new block node
|
// move the sibling nodes into the new block node
|
||||||
siblings.forEach((node, i) => {
|
siblings.forEach((node, i) => {
|
||||||
|
Reference in New Issue
Block a user