Skip to main content

parse_rich_text

Function parse_rich_text 

Source
pub fn parse_rich_text(markup: &str) -> Vec<TextSpan>
Expand description

Parses a simple markup string into a list of TextSpans.

Supported tags:

  • [color:r,g,b]text[/color] — RGB color (0..1 floats)
  • [rgba:r,g,b,a]text[/rgba] — RGBA color
  • [emit:v]text[/emit] — emission strength
  • [scale:x,y]text[/scale] — per-span scale
  • [bold]text[/bold] — treated as scale:1.2,1.2
  • [wave]text[/wave] — marks span for wavy animation (emission > 0)