Skip to content

eo-typewriterjs


eo-typewriterjs / segmentRichText

Function: segmentRichText()

ts
function segmentRichText(document): TRichTextSegment[];

Defined in: core/state/helpers/segment-rich-text.helper.ts:86

Parameters

ParameterTypeDescription
documentTRichTextDocumentThe rich-text document to segment

Returns

TRichTextSegment[]

An ordered array of TRichTextSegment values covering the full text

Description

Segment a rich-text document into non-overlapping runs based on its styles. Each segment carries the stack of active TStyleRef values that cover it. Segments with no active styles are included with an empty styles array.

Released under the MIT License.