Skip to content

MD011 - Fix reversed link syntax

Aliases: no-reversed-links

What this rule does

Detects and fixes links where the text and URL are accidentally swapped, converting them to proper Markdown format.

Why this matters

  • Broken links: Reversed syntax creates text that looks like a link but doesn't work
  • User frustration: Readers click on non-functional links and get confused
  • SEO impact: Search engines can't follow improperly formatted links
  • Professional appearance: Correctly formatted links show attention to detail

Examples

✅ Correct

Check out [our documentation](https://docs.example.com)
Visit the [GitHub repository](https://github.com/example/repo)
Contact us at [[email protected]](mailto:[email protected])

❌ Incorrect

Check out (our documentation)[https://docs.example.com]
Visit the (GitHub repository)[https://github.com/example/repo]
Contact us at ([email protected])[mailto:[email protected]]

🔧 Fixed

Check out [our documentation](https://docs.example.com)
Visit the [GitHub repository](https://github.com/example/repo)
Contact us at [[email protected]](mailto:[email protected])

Configuration

This rule has no configuration options.

Automatic fixes

This rule automatically swaps the text and URL to create properly formatted links. It even handles complex cases like nested parentheses in link text correctly.

Learn more

  • MD034 - Format bare URLs properly
  • MD039 - Remove spaces inside link text
  • MD042 - Fix empty links