1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-12 02:03:59 +02:00

fix node methods that didnt normalize keys, closes #489

This commit is contained in:
Ian Storm Taylor
2016-12-02 09:48:47 -08:00
parent f7c1e80afb
commit 7814964773

View File

@@ -387,6 +387,9 @@ const Node = {
*/ */
getCommonAncestor(one, two) { getCommonAncestor(one, two) {
one = Normalize.key(one)
two = Normalize.key(two)
if (one == this.key) return this if (one == this.key) return this
if (two == this.key) return this if (two == this.key) return this
@@ -514,6 +517,9 @@ const Node = {
*/ */
areDescendantSorted(key1, key2) { areDescendantSorted(key1, key2) {
key1 = Normalize.key(key1)
key2 = Normalize.key(key2)
let sorted let sorted
this.forEachDescendant(n => { this.forEachDescendant(n => {