mirror of
https://github.com/ueberdosis/tiptap.git
synced 2025-06-07 09:25:29 +08:00

* use named exports instead of default exports * fix tests Co-authored-by: Philipp Kühn <philippkuehn@MacBook-Pro-von-Philipp.local>
19 lines
420 B
TypeScript
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)
|
|
}
|