1
0
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:
Blake Embrey
2018-01-25 13:08:17 -08:00
committed by Ian Storm Taylor
parent 7d5a33025b
commit 4e8dd7405a
4 changed files with 63 additions and 39 deletions

View File

@@ -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)
}