tiptap/packages/core/src/helpers/getText.ts
Philipp Kühn e07a5b625d
refactor: Use named exports instead of default exports (#2238)
* use named exports instead of default exports

* fix tests

Co-authored-by: Philipp Kühn <philippkuehn@MacBook-Pro-von-Philipp.local>
2021-12-06 12:00:09 +01:00

19 lines
420 B
TypeScript

import { TextSerializer } from '../types'
import { Node as ProseMirrorNode } from 'prosemirror-model'
import { getTextBetween } from './getTextBetween'
export function getText(
node: ProseMirrorNode,
options?: {
blockSeparator?: string,
textSerializers?: Record<string, TextSerializer>,
},
) {
const range = {
from: 0,
to: node.content.size,
}
return getTextBetween(node, range, options)
}