Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

MD039 - Spaces Inside Link Text

Spaces inside link text brackets.

Why This Rule Exists

Leading or trailing spaces inside link text brackets create inconsistent formatting and may render with unwanted whitespace in the clickable text.

Examples

Incorrect

[ Click here ](https://example.com)

[  Documentation  ](./docs.md)

[ Link ](url)

Correct

[Click here](https://example.com)

[Documentation](./docs.md)

[Link](url)

Configuration

This rule has no configuration options.

When to Disable

  • Generally should not be disabled as spaced link text is usually unintentional

Rule Details

  • Rule ID: MD039
  • Aliases: no-space-in-links
  • Category: Links
  • Severity: Warning
  • Auto-fix: Yes (removes extra spaces)
  • MD037 - Spaces inside emphasis
  • MD038 - Spaces inside code spans
  • MD042 - Empty links
  • MD051 - Link fragments