MD042 - no-empty-links¶
Description¶
This rule is triggered when an empty link is encountered. Empty links have no destination or contain only an empty fragment (#). This applies to inline links, as well as full, collapsed, and shortcut reference links whose definition points to an empty destination. Links must have a valid destination to function properly.
Rationale¶
Empty links do not lead anywhere and therefore don't function as links. They may indicate incomplete content or a placeholder that was never filled in.
Examples¶
Invalid¶
# Empty Links
This is an [empty link]().
This is an [empty fragment](#).
Here is [another empty]( ).
Valid¶
# Valid Links
This is a [proper link](https://example.com/).
This is a [fragment link](#section).
Here is a [reference link][ref].
[ref]: https://example.com/reference