Expand description
ANSI SGR (Select Graphic Rendition) + OSC 8 hyperlink parser.
The parser is byte-driven (not char-driven) because ANSI sequences are
ASCII-only and we want to operate on raw input from arbitrary sources.
Public API: Style, Color, ParseState, step, strip_sgr.
Structs§
Enums§
- Color
- Parse
State - Parse
Step - Single-step transition driven by one input byte.
Functions§
- step
- Apply one input byte to the state machine.
styleandhyperlinkare updated in place when relevant sequences complete. - strip_
sgr - Strip SGR / CSI / OSC sequences from a byte slice. Returns a
Cow<[u8]>that borrows the input when no sequences are present (common case) and owns a new buffer otherwise.