2022-10-30 15:13:19 -07:00
|
|
|
# `MD042` - No empty links
|
2022-10-29 23:21:45 -07:00
|
|
|
|
2022-10-30 15:13:19 -07:00
|
|
|
Tags: `links`
|
2022-10-29 23:21:45 -07:00
|
|
|
|
2022-10-30 15:13:19 -07:00
|
|
|
Aliases: `no-empty-links`
|
2022-10-29 23:21:45 -07:00
|
|
|
|
|
|
|
This rule is triggered when an empty link is encountered:
|
|
|
|
|
|
|
|
```markdown
|
|
|
|
[an empty link]()
|
|
|
|
```
|
|
|
|
|
|
|
|
To fix the violation, provide a destination for the link:
|
|
|
|
|
|
|
|
```markdown
|
|
|
|
[a valid link](https://example.com/)
|
|
|
|
```
|
|
|
|
|
|
|
|
Empty fragments will trigger this rule:
|
|
|
|
|
|
|
|
```markdown
|
|
|
|
[an empty fragment](#)
|
|
|
|
```
|
|
|
|
|
|
|
|
But non-empty fragments will not:
|
|
|
|
|
|
|
|
```markdown
|
|
|
|
[a valid fragment](#fragment)
|
|
|
|
```
|
|
|
|
|
2022-11-05 17:34:37 -07:00
|
|
|
Rationale: Empty links do not lead anywhere and therefore don't function as
|
|
|
|
links.
|