1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-04-21 22:02:05 +02:00

change getMarks to return an ordered set (#672)

This commit is contained in:
Ian Storm Taylor 2017-03-21 17:25:59 -07:00 committed by GitHub
parent 8f7cf95ee6
commit 376eada539

View File

@ -6,7 +6,7 @@ import generateKey from '../utils/generate-key'
import isInRange from '../utils/is-in-range'
import memoize from '../utils/memoize'
import warn from '../utils/warn'
import { List, Set } from 'immutable'
import { List, OrderedSet, Set } from 'immutable'
/**
* Node.
@ -688,7 +688,7 @@ const Node = {
getMarks() {
return this
.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.
return this
.getCharactersAtRange(range)
.reduce((memo, char) => memo.union(char.marks), new Set())
.reduce((memo, char) => memo.union(char.marks), new OrderedSet())
},
/**