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

MD053 - Link and Image Reference Definitions

Link and image reference definitions should be needed.

Why This Rule Exists

Unused reference definitions clutter documents and may indicate dead links or incomplete edits. Keeping only used definitions improves maintainability.

Examples

Incorrect

Check out the [documentation](https://docs.example.com).

[unused]: https://example.com
[also-unused]: https://other.com

The definitions are never used.

Correct

Check out the [documentation][docs].

[docs]: https://docs.example.com

Or remove unused definitions:

Check out the [documentation](https://docs.example.com).

Configuration

[MD053]
ignored_definitions = []  # Definitions to ignore (e.g., for includes)

Ignoring Definitions

[MD053]
ignored_definitions = ["//", "TODO"]

When to Disable

  • Documents with definitions used in included content
  • Templates with conditional reference usage
  • Files serving as definition libraries

Rule Details

  • Rule ID: MD053
  • Aliases: link-image-reference-definitions
  • Category: Links
  • Severity: Warning
  • Auto-fix: No
  • MD052 - Reference links must be defined
  • MD054 - Link and image style