pub fn trim_lines(input: &str) -> String
Trims each logical line independently and preserves the input line-ending style when possible.