mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-18 05:01:17 +02:00
Fix selection replacement and marks (#1473)
* Fix selection replacement and marks * Create `getInsertMarks` method for text insertion
This commit is contained in:
committed by
Ian Storm Taylor
parent
7d5a33025b
commit
4e8dd7405a
@@ -492,7 +492,7 @@ function AfterPlugin() {
|
||||
if (startBlock.isVoid) return
|
||||
|
||||
const defaultBlock = startBlock
|
||||
const defaultMarks = document.getMarksAtRange(selection.collapseToStart())
|
||||
const defaultMarks = document.getInsertMarksAtRange(selection)
|
||||
const frag = Plain.deserialize(text, { defaultBlock, defaultMarks }).document
|
||||
change.insertFragment(frag)
|
||||
}
|
||||
|
Reference in New Issue
Block a user