mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-11 17:53:59 +02:00
change getMarks to return an ordered set (#672)
This commit is contained in:
@@ -6,7 +6,7 @@ import generateKey from '../utils/generate-key'
|
|||||||
import isInRange from '../utils/is-in-range'
|
import isInRange from '../utils/is-in-range'
|
||||||
import memoize from '../utils/memoize'
|
import memoize from '../utils/memoize'
|
||||||
import warn from '../utils/warn'
|
import warn from '../utils/warn'
|
||||||
import { List, Set } from 'immutable'
|
import { List, OrderedSet, Set } from 'immutable'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Node.
|
* Node.
|
||||||
@@ -688,7 +688,7 @@ const Node = {
|
|||||||
getMarks() {
|
getMarks() {
|
||||||
return this
|
return this
|
||||||
.getCharacters()
|
.getCharacters()
|
||||||
.reduce((marks, char) => marks.union(char.marks), new Set())
|
.reduce((marks, char) => marks.union(char.marks), new OrderedSet())
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -720,7 +720,7 @@ const Node = {
|
|||||||
// Otherwise, get a set of the marks for each character in the range.
|
// Otherwise, get a set of the marks for each character in the range.
|
||||||
return this
|
return this
|
||||||
.getCharactersAtRange(range)
|
.getCharactersAtRange(range)
|
||||||
.reduce((memo, char) => memo.union(char.marks), new Set())
|
.reduce((memo, char) => memo.union(char.marks), new OrderedSet())
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user