mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-10 07:04:18 +00:00
Auto merge of #13195 - GuillaumeGomez:fix-false-positive-13183, r=Manishearth
Fix false positive for `missing_backticks` in footnote references Fixes #13183. changelog: Fix false positive for `missing_backticks` in footnote references
This commit is contained in:
commit
5542309895
2 changed files with 13 additions and 2 deletions
|
@ -768,7 +768,7 @@ fn check_doc<'a, Events: Iterator<Item = (pulldown_cmark::Event<'a>, Range<usize
|
|||
);
|
||||
}
|
||||
},
|
||||
FootnoteReference(text) | Text(text) => {
|
||||
Text(text) => {
|
||||
paragraph_range.end = range.end;
|
||||
let range_ = range.clone();
|
||||
ticks_unbalanced |= text.contains('`')
|
||||
|
@ -812,7 +812,8 @@ fn check_doc<'a, Events: Iterator<Item = (pulldown_cmark::Event<'a>, Range<usize
|
|||
}
|
||||
text_to_check.push((text, range, code_level));
|
||||
}
|
||||
},
|
||||
}
|
||||
FootnoteReference(_) => {}
|
||||
}
|
||||
}
|
||||
headers
|
||||
|
|
10
tests/ui/doc/footnote_issue_13183.rs
Normal file
10
tests/ui/doc/footnote_issue_13183.rs
Normal file
|
@ -0,0 +1,10 @@
|
|||
// This is a regression test for <https://github.com/rust-lang/rust-clippy/issues/13183>.
|
||||
// It should not warn on missing backticks on footnote references.
|
||||
|
||||
#![warn(clippy::doc_markdown)]
|
||||
// Should not warn!
|
||||
//! Here's a footnote[^example_footnote_identifier]
|
||||
//!
|
||||
//! [^example_footnote_identifier]: This is merely an example.
|
||||
|
||||
fn main() {}
|
Loading…
Reference in a new issue