MD039 - no-space-in-links¶
Description¶
This rule is triggered when a link contains spaces at the beginning or end of the link text. The link text is the portion inside the square brackets.
Rationale¶
Consistent formatting makes it easier to understand a document. Spaces at the beginning or end of link text are usually accidental and can look awkward when rendered.
Examples¶
Invalid¶
# Links with Spaces
This is a [ link with leading space](https://www.example.com/).
Here is [link with trailing space ](https://example.org/page) in a sentence.
And [ spaces on both sides ](https://example.net/) is also wrong.
Valid¶
# Valid Links
This is a [properly formatted link](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