fix bug in clipboardTextSerializer

This commit is contained in:
Philipp Kühn 2021-09-09 23:58:43 +02:00
parent 4ecd41b922
commit 6faceef3f6

View File

@ -1,6 +1,7 @@
import { Plugin, PluginKey } from 'prosemirror-state'
import { Extension } from '../Extension'
import getTextBetween from '../helpers/getTextBetween'
import getTextSeralizersFromSchema from '../helpers/getTextSeralizersFromSchema'
export const ClipboardTextSerializer = Extension.create({
name: 'editable',
@ -12,10 +13,10 @@ export const ClipboardTextSerializer = Extension.create({
props: {
clipboardTextSerializer: () => {
const { editor } = this
const { state, extensionManager } = editor
const { state, schema } = editor
const { doc, selection } = state
const { from, to } = selection
const { textSerializers } = extensionManager
const textSerializers = getTextSeralizersFromSchema(schema)
const range = { from, to }
return getTextBetween(doc, range, {