Table of Contents

Class CliMarkupParser

Namespace
ItTiger.TigerCli.Markup
Assembly
ItTiger.TigerCli.dll
Parses TigerCli bracket markup into styled text segments. Mirrors TigerConsole.Markup semantics but produces data instead of writing to the console.
public static class CliMarkupParser
Inheritance
CliMarkupParser
Inherited Members

Methods

Escape(string)

Escapes markup-significant brackets in raw text so it can be inserted into TigerCli markup as literal text. This method does not perform localization.
public static string Escape(string text)

Parameters

text string

Returns

string

Parse(string, CliCharStyle?, IMarkupStyleResolver?, IColorAliasResolver?)

Parse markup into a flat list of segments. The base style is used as the starting style (foreground/background). Nested tags override those selectively and are properly unwound by [/]. When styles is supplied, a simple single-name tag is first resolved as a curated semantic token (e.g. [Accent], [Alert]); semantic names take precedence over raw colour names. When it is null, behaviour is unchanged (raw colours only). When colorAliases is supplied, raw colour positions (foreground and the background after on) first consult registered colour aliases, which take precedence over CliColor enum names; semantic style names are never accepted in raw colour positions. The parser stays pure — it never reads a theme, an alias table, or global console state; both resolvers are injected by the call site.
public static List<CliTextSegment> Parse(string markup, CliCharStyle? baseStyle = null, IMarkupStyleResolver? styles = null, IColorAliasResolver? colorAliases = null)

Parameters

markup string
baseStyle CliCharStyle?
styles IMarkupStyleResolver
colorAliases IColorAliasResolver

Returns

List<CliTextSegment>