@@ -7,7 +7,7 @@ use clippy_utils::{is_entrypoint_fn, method_chain_args};
7
7
use pulldown_cmark:: Event :: {
8
8
Code , End , FootnoteReference , HardBreak , Html , Rule , SoftBreak , Start , TaskListMarker , Text ,
9
9
} ;
10
- use pulldown_cmark:: Tag :: { CodeBlock , Heading , Item , Link , Paragraph } ;
10
+ use pulldown_cmark:: Tag :: { BlockQuote , CodeBlock , Heading , Item , Link , Paragraph } ;
11
11
use pulldown_cmark:: { BrokenLink , CodeBlockKind , CowStr , Options } ;
12
12
use rustc_ast:: ast:: Attribute ;
13
13
use rustc_data_structures:: fx:: FxHashSet ;
@@ -602,6 +602,7 @@ fn check_doc<'a, Events: Iterator<Item = (pulldown_cmark::Event<'a>, Range<usize
602
602
let mut text_to_check: Vec < ( CowStr < ' _ > , Range < usize > , isize ) > = Vec :: new ( ) ;
603
603
let mut paragraph_range = 0 ..0 ;
604
604
let mut code_level = 0 ;
605
+ let mut blockquote_level = 0 ;
605
606
606
607
for ( event, range) in events {
607
608
match event {
@@ -612,6 +613,8 @@ fn check_doc<'a, Events: Iterator<Item = (pulldown_cmark::Event<'a>, Range<usize
612
613
code_level -= 1 ;
613
614
}
614
615
} ,
616
+ Start ( BlockQuote ) => blockquote_level += 1 ,
617
+ End ( BlockQuote ) => blockquote_level -= 1 ,
615
618
Start ( CodeBlock ( ref kind) ) => {
616
619
in_code = true ;
617
620
if let CodeBlockKind :: Fenced ( lang) = kind {
@@ -663,7 +666,7 @@ fn check_doc<'a, Events: Iterator<Item = (pulldown_cmark::Event<'a>, Range<usize
663
666
} else {
664
667
for ( text, range, assoc_code_level) in text_to_check {
665
668
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 ) ;
667
670
}
668
671
}
669
672
}
0 commit comments