eo-typewriterjs / segmentRichText
Function: segmentRichText()
ts
function segmentRichText(document): TRichTextSegment[];Defined in: core/state/helpers/segment-rich-text.helper.ts:86
Parameters
| Parameter | Type | Description |
|---|---|---|
document | TRichTextDocument | The rich-text document to segment |
Returns
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.