Skip to content

Rule - MD011#

Property Value
Aliases md011, no-reversed-links
Autofix Available Pending
Enabled By Default Yes

Summary#

Reversed link syntax.

Reasoning#

Correctness#

When typing quickly, it is possible to transpose the [] characters and the () characters, resulting in text that does not represent the intended link. This pattern has probably happened enough times that the original rule was authored to correct for situations like this.

Examples#

Failure Scenarios#

This rule triggers when any non-code block, non-HTML block line contains an Inline Link that appears to have the [] characters and the () characters transposed:

Markdown This link (is)[/transposed].

Correct Scenarios#

To correct the above example, transpose the [] characters and the () characters to their correct order:

Markdown This link [is not](/transposed).

Note that some parsers implement the Markdown Extra footnotes, and it is possible to construct a legal footnote that may look like a reversed link:

Markdown ... to it (as an example)[^footnote]. Therefore...

To accommodate those footnotes sequences, if the apparent URL section starts with a ^ character, this rule will not trigger.

Fix Description#

The auto-fix feature for this rule is scheduled to be added soon after the v1.0.0 release.

Configuration#

Prefixes
plugins.md011.
plugins.no-reversed-links.
Value Name Type Default Description
enabled boolean True Whether the Rule Plugin is enabled.

Origination of Rule#

This rule is largely inspired by the MarkdownLint rule MD011.