Skip to main content

normalize_text

Function normalize_text 

Source
pub fn normalize_text(value: &str, multiline: bool) -> Cow<'_, str>
Expand description

Canonical editable text: CRLF/CR become LF in multiline controls, line breaks are removed from single-line host input, and NUL becomes U+FFFD. Programmatic single-line values must reject line breaks before calling this. Already canonical text is borrowed without an allocation.