mirror of
https://github.com/rust-lang/rust-clippy
synced 2025-02-17 06:28:42 +00:00
Auto merge of #7426 - ebobrow:doc-markdown-fp, r=llogiq
fix doc_markdown false positive fixes #7421 changelog: don't lint unbalanced tick marks in code blocks
This commit is contained in:
commit
c195db7fee
2 changed files with 8 additions and 1 deletions
|
@ -549,7 +549,7 @@ fn check_doc<'a, Events: Iterator<Item = (pulldown_cmark::Event<'a>, Range<usize
|
|||
FootnoteReference(text) | Text(text) => {
|
||||
let (begin, span) = get_current_span(spans, range.start);
|
||||
paragraph_span = paragraph_span.with_hi(span.hi());
|
||||
ticks_unbalanced |= text.contains('`');
|
||||
ticks_unbalanced |= text.contains('`') && !in_code;
|
||||
if Some(&text) == in_link.as_ref() || ticks_unbalanced {
|
||||
// Probably a link of the form `<http://example.com>`
|
||||
// Which are represented as a link to "http://example.com" with
|
||||
|
|
|
@ -34,3 +34,10 @@ fn in_code_block() {}
|
|||
/// - This `item has unbalanced tick marks
|
||||
/// - This item needs backticks_here
|
||||
fn other_markdown() {}
|
||||
|
||||
#[rustfmt::skip]
|
||||
/// - ```rust
|
||||
/// /// `lol`
|
||||
/// pub struct Struct;
|
||||
/// ```
|
||||
fn iss_7421() {}
|
||||
|
|
Loading…
Add table
Reference in a new issue