Skip to content

Latest commit

 

History

History
40 lines (26 loc) · 875 Bytes

File metadata and controls

40 lines (26 loc) · 875 Bytes

MD039 - Spaces inside link text

Tags: whitespace, links

Aliases: no-space-in-links

Parameters: N/A

This rule is triggered when spaces are present inside the square brackets of a link text.

Examples

Incorrect

[ link text ](https://example.com)
[link text ](https://example.com)
[ link text](https://example.com)

Correct

[link text](https://example.com)

Rationale

Spaces inside link text can indicate a mistake or inconsistent formatting. They also make links less readable and may cause issues with some markdown parsers.

Notes

This rule applies to:

  • Inline links: [text](url)
  • Reference links: [text][ref]
  • Collapsed reference links: [text][]

This rule does NOT apply to:

  • Images: ![alt text](image.jpg) (spaces in image alt text are allowed)
  • Text in brackets that is not a link: [ not a link ]