Skip to content

RichTextEngine

Defined in: src/render/rich/text.ts:76

Builds styled text from inline markup into Spans (the engine behind RichText; exported as RichTextEngine).

new RichTextEngine(plain, spans?): RichText

Defined in: src/render/rich/text.ts:82

string

Span[] = []

RichText

readonly plain: string

Defined in: src/render/rich/text.ts:78

The text with markup stripped.


readonly spans: Span[]

Defined in: src/render/rich/text.ts:80

Styled ranges over plain.

toSegments(baseStyle?): Segment[]

Defined in: src/render/rich/text.ts:185

Convert the RichText structure to rendering Segments.

Style = Style.DEFAULT

Segment[]


static fromMarkup(markup): RichText

Defined in: src/render/rich/text.ts:91

Parse console markup (e.g., “[bold red]hello[/bold red]” or “[bold]hello[/]”) into a RichText instance. Supports escaping with backslashes.

string

RichText