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:
@@ -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 => {
|
||||||
|
Reference in New Issue
Block a user