Skip to main content

text_clean

Function text_clean 

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

Clean and normalize text for display.

Applies NFKC normalization, removes control characters (except newlines), normalizes \r\n to \n, collapses consecutive empty lines to at most one, and strips leading/trailing whitespace.