Skip to content

EditorState.sliceDoc method

EditorState › sliceDoc

Official

Return the given range of the document as a string.

Signature:

sliceDoc(from?: number | undefined, to?: number | undefined): string

Parameters:

ParameterTypeDescription
from?number | undefinedThe start position.
to?number | undefinedThe end position.

Returns: stringThe document slice.