Skip to content

Commit

Permalink
Merge pull request #2 from TheoremOne/decorations-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jemc authored Mar 31, 2022
2 parents 21d4599 + bc6252b commit 22f021a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/slate/src/interfaces/text.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,12 @@ export const Text: TextInterface = {
const offset = o
o += length

// If the range encompases the entire leaf, add the range.
if (start.offset <= offset && end.offset >= o) {
// If the range encompases the entire leaf (and the range is non-empty), add the range.
if (
start.offset <= offset &&
end.offset >= o &&
start.offset < end.offset
) {
Object.assign(leaf, rest)
next.push(leaf)
continue
Expand Down

0 comments on commit 22f021a

Please sign in to comment.