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:

Parameter Type Description
from? number | undefined The start position.
to? number | undefined The end position.

Returns: stringThe document slice.