MD011 - no-reversed-links¶
Description¶
This rule is triggered when text that appears to be a link is encountered, but where the syntax appears to have been reversed (the [] and () are reversed).
Note: Footnotes such as (text)[^1] do not trigger this rule.
Rationale¶
Reversed links are not rendered as usable links. The text will appear literally as (text)[url] instead of being converted to a clickable hyperlink. This is a common mistake where the author specified the incorrect order of link components.
Examples¶
Invalid¶
# Reversed Links
This is a document with (incorrect link syntax)[https://www.example.com/].
Here is (another bad link)[https://example.org/page] in a sentence.
Valid¶
# Valid Links
This is a document with [correct link syntax](https://www.example.com/).
Here is [another link](https://example.org/page) in a sentence.
Reference links [like this][ref] are also fine.
[ref]: https://example.com/reference