1
0
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:
Isaac Schultz
2020-10-29 17:56:14 -07:00
committed by GitHub
parent 4ae58e5c95
commit d3f88fb922
2 changed files with 22309 additions and 3 deletions

22302
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -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++
}
})