mirror of
https://github.com/ueberdosis/tiptap.git
synced 2025-06-07 01:12:56 +08:00
fix: add support for multiple ranges in clipboardTextSerializer, fix #1982
This commit is contained in:
parent
4cb9fe0e27
commit
98a1cb3640
@ -15,7 +15,9 @@ export const ClipboardTextSerializer = Extension.create({
|
||||
const { editor } = this
|
||||
const { state, schema } = editor
|
||||
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 range = { from, to }
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user