Skip to content

segments

segments(text, lints, priority?): Segment[]

Defined in: linter.ts:119

Flatten possibly-overlapping lints into non-overlapping segments, so a UI can wrap each in exactly one span/mark. When lints contend for a character, the one with the LOWER priority(lint) number wins (ties keep the first seen). Default priority is 0 for all — pass a priority (e.g. from a pack’s category order) to make overlaps deterministic.

string

Lint[]

(lint) => number

Segment[]