Fix split_node missing properties bug.

This commit is contained in:
Ulion 2020-12-29 17:55:29 +08:00
parent cc4449e6dd
commit 867d7c9e8d

View File

@ -8,7 +8,10 @@ const splitNode = (doc: SyncValue, op: SplitNodeOperation): SyncValue => {
const [parent, index]: [any, number] = getParent(doc, op.path) const [parent, index]: [any, number] = getParent(doc, op.path)
const target = getChildren(parent)[index] const target = getChildren(parent)[index]
const inject = cloneNode(target) const inject = {
...cloneNode(target),
...op.properties
}
if (target.text) { if (target.text) {
target.text.length > op.position && target.text.length > op.position &&