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:
bors 2021-07-03 16:53:21 +00:00
commit c195db7fee
2 changed files with 8 additions and 1 deletions

View file

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

View file

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