mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-30 10:29:48 +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 entry = Editor.node(editor, path)
|
||||
editor.normalizeNode(entry)
|
||||
const dirtyPath = getDirtyPaths(editor).pop()!
|
||||
|
||||
// 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++
|
||||
}
|
||||
})
|
||||
|
Reference in New Issue
Block a user