Skip to content

Commit

Permalink
fix: add support for multiple ranges in clipboardTextSerializer, fix #…
Browse files Browse the repository at this point in the history
  • Loading branch information
Philipp Kühn authored and Philipp Kühn committed Dec 5, 2021
1 parent 4cb9fe0 commit 98a1cb3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/core/src/extensions/clipboardTextSerializer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 }

Expand Down

0 comments on commit 98a1cb3

Please sign in to comment.