Fix false positive for missing_backticks in footnote references

This commit is contained in:
Guillaume Gomez 2024-07-31 17:20:02 +02:00
parent 8f3cfb4974
commit edca73003b
2 changed files with 13 additions and 2 deletions

View File

@ -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

View 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() {}