@@ -7,7 +7,7 @@ use clippy_utils::{is_entrypoint_fn, method_chain_args};
77use pulldown_cmark:: Event :: {
88 Code , End , FootnoteReference , HardBreak , Html , Rule , SoftBreak , Start , TaskListMarker , Text ,
99} ;
10- use pulldown_cmark:: Tag :: { CodeBlock , Heading , Item , Link , Paragraph } ;
10+ use pulldown_cmark:: Tag :: { BlockQuote , CodeBlock , Heading , Item , Link , Paragraph } ;
1111use pulldown_cmark:: { BrokenLink , CodeBlockKind , CowStr , Options } ;
1212use rustc_ast:: ast:: Attribute ;
1313use rustc_data_structures:: fx:: FxHashSet ;
@@ -602,6 +602,7 @@ fn check_doc<'a, Events: Iterator<Item = (pulldown_cmark::Event<'a>, Range<usize
602602 let mut text_to_check: Vec < ( CowStr < ' _ > , Range < usize > , isize ) > = Vec :: new ( ) ;
603603 let mut paragraph_range = 0 ..0 ;
604604 let mut code_level = 0 ;
605+ let mut blockquote_level = 0 ;
605606
606607 for ( event, range) in events {
607608 match event {
@@ -612,6 +613,8 @@ fn check_doc<'a, Events: Iterator<Item = (pulldown_cmark::Event<'a>, Range<usize
612613 code_level -= 1 ;
613614 }
614615 } ,
616+ Start ( BlockQuote ) => blockquote_level += 1 ,
617+ End ( BlockQuote ) => blockquote_level -= 1 ,
615618 Start ( CodeBlock ( ref kind) ) => {
616619 in_code = true ;
617620 if let CodeBlockKind :: Fenced ( lang) = kind {
@@ -663,7 +666,7 @@ fn check_doc<'a, Events: Iterator<Item = (pulldown_cmark::Event<'a>, Range<usize
663666 } else {
664667 for ( text, range, assoc_code_level) in text_to_check {
665668 if let Some ( span) = fragments. span ( cx, range) {
666- markdown:: check ( cx, valid_idents, & text, span, assoc_code_level) ;
669+ markdown:: check ( cx, valid_idents, & text, span, assoc_code_level, blockquote_level ) ;
667670 }
668671 }
669672 }
0 commit comments