mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-12 18:24:03 +02:00
fix node methods that didnt normalize keys, closes #489
This commit is contained in:
@@ -387,6 +387,9 @@ const Node = {
|
||||
*/
|
||||
|
||||
getCommonAncestor(one, two) {
|
||||
one = Normalize.key(one)
|
||||
two = Normalize.key(two)
|
||||
|
||||
if (one == this.key) return this
|
||||
if (two == this.key) return this
|
||||
|
||||
@@ -514,6 +517,9 @@ const Node = {
|
||||
*/
|
||||
|
||||
areDescendantSorted(key1, key2) {
|
||||
key1 = Normalize.key(key1)
|
||||
key2 = Normalize.key(key2)
|
||||
|
||||
let sorted
|
||||
|
||||
this.forEachDescendant(n => {
|
||||
|
Reference in New Issue
Block a user