mirror of
https://github.com/ueberdosis/tiptap.git
synced 2025-01-18 06:03:22 +08:00
fix bug in clipboardTextSerializer
This commit is contained in:
parent
4ecd41b922
commit
6faceef3f6
@ -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, {
|
||||
|
Loading…
Reference in New Issue
Block a user