Skip to content

Commit 8ef025a

Browse files
authored
FIX: preserve_empty_first_line ignored
Making `preserve_empty_first_line` argument affect naked CRLF first line.
1 parent 07c8ac4 commit 8ef025a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/unindent.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ fn do_unindent_bytes(s: &[u8], preserve_empty_first_line: bool) -> Vec<u8> {
2222
// Document may start either on the same line as opening quote or
2323
// on the next line
2424
let ignore_first_line =
25-
!preserve_empty_first_line && s.starts_with(b"\n") || s.starts_with(b"\r\n");
25+
!preserve_empty_first_line && (s.starts_with(b"\n") || s.starts_with(b"\r\n"));
2626

2727
// Largest number of spaces that can be removed from every
2828
// non-whitespace-only line after the first

0 commit comments

Comments
 (0)