fix doc_markdown false positive

This commit is contained in:
Elliot Bobrow 2021-07-03 09:34:10 -07:00
parent 8d427b624f
commit e9a5694597
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() {}