1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-04-21 22:02:05 +02:00

fix warnings on copy fragment, closes #434

This commit is contained in:
Ian Storm Taylor 2016-11-18 12:41:05 -08:00
parent 73c007ded1
commit ada5a6f807

View File

@ -573,12 +573,12 @@ const Node = {
node = node.splitBlockAtRange(end, Infinity)
// Get the start and end nodes.
const startNode = node.getNextSibling(node.getHighestChild(startKey))
const startNode = node.getNextSibling(node.getHighestChild(startKey).key)
const endNode = startKey == endKey
? node.getHighestChild(next)
? node.getHighestChild(next.key)
: node.getHighestChild(endKey)
nodes = node.getChildrenBetweenIncluding(startNode, endNode)
nodes = node.getChildrenBetweenIncluding(startNode.key, endNode.key)
// Return a new document fragment.
return Document.create({ nodes })