mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-02-13 11:44:55 +01:00
Fixing the bug that getMarks steals mark from the previous block (#1645)
This commit is contained in:
parent
324a025ee9
commit
1776d8e64c
@ -1130,6 +1130,11 @@ class Node {
|
||||
if (startOffset == 0) {
|
||||
const previous = this.getPreviousText(startKey)
|
||||
if (!previous || previous.text.length == 0) return []
|
||||
if (
|
||||
this.getClosestBlock(startKey) !== this.getClosestBlock(previous.key)
|
||||
) {
|
||||
return []
|
||||
}
|
||||
const char = previous.characters.get(previous.text.length - 1)
|
||||
return char.marks.toArray()
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user