prosemirror-flat-list
Version:
Powerful list support for ProseMirror
14 lines (11 loc) • 355 B
text/typescript
import type { NodeRange } from 'prosemirror-model'
import { cutByIndex } from './cut-by-index'
/**
* Return a debugging string that describes this range.
*
* @internal
*/
export function rangeToString(range: NodeRange): string {
const { parent, startIndex, endIndex } = range
return cutByIndex(parent.content, startIndex, endIndex).toString()
}