mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-02-13 11:44:55 +01:00
fix inverting of split_node and merge_node operations
This commit is contained in:
parent
65c583f695
commit
59a7197f81
@ -186,6 +186,7 @@ Changes.mergeNodeByKey = (change, key, options = {}) => {
|
||||
value,
|
||||
path,
|
||||
position,
|
||||
target: null,
|
||||
})
|
||||
|
||||
if (normalize) {
|
||||
|
@ -29,6 +29,7 @@ const OPERATION_ATTRIBUTES = {
|
||||
'value',
|
||||
'path',
|
||||
'position',
|
||||
'target',
|
||||
],
|
||||
move_node: [
|
||||
'value',
|
||||
|
@ -104,7 +104,6 @@ class Operation extends Record(DEFAULTS) {
|
||||
if (key == 'document') continue
|
||||
if (key == 'selection') continue
|
||||
if (key == 'node' && type != 'insert_node') continue
|
||||
if (key == 'target' && type == 'split_node') continue
|
||||
|
||||
throw new Error(`\`Operation.fromJSON\` was passed a "${type}" operation without the required "${key}" attribute.`)
|
||||
}
|
||||
@ -224,7 +223,6 @@ class Operation extends Record(DEFAULTS) {
|
||||
if (key == 'selection') continue
|
||||
if (key == 'value') continue
|
||||
if (key == 'node' && type != 'insert_node') continue
|
||||
if (key == 'target' && type == 'split_node') continue
|
||||
|
||||
if (key == 'mark' || key == 'marks' || key == 'node') {
|
||||
value = value.toJSON()
|
||||
|
Loading…
x
Reference in New Issue
Block a user