Skip to content

Commit 03d7ae8

Browse files
Also handle <blockquote> and <q> HTML tags
1 parent cd36b25 commit 03d7ae8

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

clippy_lints/src/doc/mod.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -611,6 +611,10 @@ fn check_doc<'a, Events: Iterator<Item = (pulldown_cmark::Event<'a>, Range<usize
611611
code_level += 1;
612612
} else if tag.starts_with("</code") {
613613
code_level -= 1;
614+
} else if tag.starts_with("<blockquote") || tag.starts_with("<q") {
615+
blockquote_level += 1;
616+
} else if tag.starts_with("</blockquote") || tag.starts_with("</q") {
617+
blockquote_level -= 1;
614618
}
615619
},
616620
Start(BlockQuote) => blockquote_level += 1,

tests/ui/doc/issue_10262.fixed

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,8 @@
55
//~^ ERROR: item in documentation is missing backticks
66
///
77
/// > AvisynthPluginInit3 may be called more than once with different IScriptEnvironments.
8+
///
9+
/// <blockquote>bla AvisynthPluginInit3 bla</blockquote>
10+
///
11+
/// <q>bla AvisynthPluginInit3 bla</q>
812
pub struct Foo;

tests/ui/doc/issue_10262.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,8 @@
55
//~^ ERROR: item in documentation is missing backticks
66
///
77
/// > AvisynthPluginInit3 may be called more than once with different IScriptEnvironments.
8+
///
9+
/// <blockquote>bla AvisynthPluginInit3 bla</blockquote>
10+
///
11+
/// <q>bla AvisynthPluginInit3 bla</q>
812
pub struct Foo;

0 commit comments

Comments
 (0)