fix: add support for multiple ranges in clipboardTextSerializer, fix #1982
This commit is contained in:
@@ -15,7 +15,9 @@ export const ClipboardTextSerializer = Extension.create({
|
|||||||
const { editor } = this
|
const { editor } = this
|
||||||
const { state, schema } = editor
|
const { state, schema } = editor
|
||||||
const { doc, selection } = state
|
const { doc, selection } = state
|
||||||
const { from, to } = selection
|
const { ranges } = selection
|
||||||
|
const from = Math.min(...ranges.map(range => range.$from.pos))
|
||||||
|
const to = Math.max(...ranges.map(range => range.$to.pos))
|
||||||
const textSerializers = getTextSeralizersFromSchema(schema)
|
const textSerializers = getTextSeralizersFromSchema(schema)
|
||||||
const range = { from, to }
|
const range = { from, to }
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user