[][src]Function cansi::categorise_text

pub fn categorise_text(text: &str) -> CategorisedSlices

Parses the text and returns each formatted slice in order. The ANSI escape codes are not included in the text slices.

Each different text slice is returned in order such that the text without the escape characters can be reconstructed. There is a helper function (construct_text_no_codes) on CategorisedSlices for this.