fn trim_trailing_newline(text: &str, line_start: usize, end: usize) -> usize
Trim a trailing \n or \r\n from a segment so it doesn’t include the line terminator.
\n
\r\n