Skip to main content

sanitize_preview

Function sanitize_preview 

Source
pub fn sanitize_preview(raw: &str) -> String
Expand description

sanitize_for_terminal, with \n/\t and the Unicode line/paragraph separators (U+2028/U+2029) then escaped into visible escape sequences instead of passed through raw. Use this for free-text content rendered inline within a single table-shaped output row (currently only search-match previews): a real newline (ASCII or Unicode) in the underlying file content stays visible to the user, but can never be mistaken for a row boundary the way a raw line break could.