Skip to main content

ansi_to_html

Function ansi_to_html 

Source
pub fn ansi_to_html(text: &str) -> String
Expand description

Convert ANSI-escaped text to HTML with inline styles.

Supports:

  • Standard foreground colors (30–37) and bright variants (90–97)
  • Standard background colors (40–47) and bright variants (100–107)
  • 256-color palette (38;5;N and 48;5;N)
  • RGB true color (38;2;R;G;B and 48;2;R;G;B)
  • Text styles: bold (1), dim (2), italic (3), underline (4), strikethrough (9)
  • Reset (0)