mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-09-01 03:11:44 +02:00
Check if a node exists before normalization in Editor.normalize (#3907)
* Check if a node exists before normalization
This commit is contained in:
22302
package-lock.json
generated
Normal file
22302
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -757,9 +757,13 @@ export const Editor = {
|
|||||||
`)
|
`)
|
||||||
}
|
}
|
||||||
|
|
||||||
const path = getDirtyPaths(editor).pop()!
|
const dirtyPath = getDirtyPaths(editor).pop()!
|
||||||
const entry = Editor.node(editor, path)
|
|
||||||
editor.normalizeNode(entry)
|
// If the node doesn't exist in the tree, it does not need to be normalized.
|
||||||
|
if (Node.has(editor, dirtyPath)) {
|
||||||
|
const entry = Editor.node(editor, dirtyPath)
|
||||||
|
editor.normalizeNode(entry)
|
||||||
|
}
|
||||||
m++
|
m++
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
Reference in New Issue
Block a user