File tree Expand file tree Collapse file tree 1 file changed +1
-11
lines changed Expand file tree Collapse file tree 1 file changed +1
-11
lines changed Original file line number Diff line number Diff line change @@ -552,17 +552,7 @@ impl ItemizedBlock {
552552/// The original line_start likely contains indentation (whitespaces), which we'd like to
553553/// replace with '> ' characters.
554554fn itemized_block_quote_start ( line : & str , mut line_start : String , remove_indent : usize ) -> String {
555- let mut quote_level = 0 ;
556- let mut chars = line. trim_start ( ) . chars ( ) . peekable ( ) ;
557-
558- while chars. peek ( ) == Some ( & '>' ) {
559- chars. next ( ) ;
560- quote_level += 1 ;
561- // Skip all spaces after '>'
562- while chars. peek ( ) == Some ( & ' ' ) {
563- chars. next ( ) ;
564- }
565- }
555+ let quote_level = line. chars ( ) . take_while ( |& c| matches ! ( c, '>' | ' ' ) ) . filter ( |& c| c == '>' ) . count ( ) ;
566556
567557 for _ in 0 ..remove_indent {
568558 line_start. pop ( ) ;
You can’t perform that action at this time.
0 commit comments