Thanks for a quick answer.
My error:
That comes from the fact, that using this EditorState
.
> `one
> two`
I iterate the nodes, and I find Blockquote
at positions 0 to 13, and inline code at positions 2 to 13.
I then parse it and try to add decorations to RangeSetBuilder
, and I do this
set.add(0, 0, Decoration.line({class: 'highlight-quote'})); // first line
set.add(7, 7, Decoration.line({class: 'highlight-quote'})); // second line
set.add(2, 13, Decoration.mark({class: 'highlight-code'})); // inline decoration
Obviously the second line should be added after the decoration of Decoration.mark()
in this case, but I don’t see a way of doing that. I don’t want to sort the decorations.
Should I implement a binary tree, to insert new decorations in order and then iterate them to add them to RangeSetBuilder
?