Skip to main content

strip_ansi

Function strip_ansi 

Source
pub fn strip_ansi(input: &str) -> Cow<'_, str>
Expand description

Strip ANSI escape sequences from a string.

Every string that comes from JS is run through this as it is written, so page content cannot smuggle terminal control codes into the output while the renderer’s own styling survives.