Skip to content

Commit 608078c

Browse files
committed
u
1 parent 470680f commit 608078c

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/comment.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,7 @@ impl ItemizedBlock {
496496
// and it's easier to reason about the final indent by just taking the length
497497
// of the new line_start. We update the indent because it effects the max width
498498
// of each formatted line.
499-
line_start = itemized_block_quote_start(line, line_start, 1);
499+
line_start = itemized_block_quote_start(line.trim_start(), line_start, 1);
500500
indent = line_start.len();
501501
}
502502

@@ -552,7 +552,11 @@ impl ItemizedBlock {
552552
/// The original line_start likely contains indentation (whitespaces), which we'd like to
553553
/// replace with '> ' characters.
554554
fn itemized_block_quote_start(line: &str, mut line_start: String, remove_indent: usize) -> String {
555-
let quote_level = line.chars().take_while(|&c| matches!(c, '>' | ' ')).filter(|&c| c == '>').count();
555+
let quote_level = line
556+
.chars()
557+
.take_while(|&c| matches!(c, '>' | ' '))
558+
.filter(|&c| c == '>')
559+
.count();
556560

557561
for _ in 0..remove_indent {
558562
line_start.pop();

0 commit comments

Comments
 (0)