diff --git a/crates/ruff_dev/src/generate_docs.rs b/crates/ruff_dev/src/generate_docs.rs index 309a61a459fcb8..009873538c82db 100644 --- a/crates/ruff_dev/src/generate_docs.rs +++ b/crates/ruff_dev/src/generate_docs.rs @@ -102,7 +102,7 @@ fn process_documentation(documentation: &str, out: &mut String, rule_name: &str) // a non-CommonMark-compliant Markdown parser, which doesn't support code // tags in link definitions // (see https://github.com/Python-Markdown/markdown/issues/280). - let documentation = Regex::new(r"\[`([^`]*?)`]($|[^\[])").unwrap().replace_all( + let documentation = Regex::new(r"\[`([^`]*?)`]($|[^\[\(])").unwrap().replace_all( documentation, |caps: &Captures| { format!( @@ -159,7 +159,7 @@ mod tests { process_documentation( " See also [`lint.mccabe.max-complexity`] and [`lint.task-tags`]. -Something [`else`][other]. +Something [`else`][other]. Some [link](https://example.com). ## Options @@ -174,7 +174,7 @@ Something [`else`][other]. output, " See also [`lint.mccabe.max-complexity`][lint.mccabe.max-complexity] and [`lint.task-tags`][lint.task-tags]. -Something [`else`][other]. +Something [`else`][other]. Some [link](https://example.com). ## Options