Link Rules
These rules ensure proper link formatting and validation in markdown documents.
Rules in This Category
Auto-fix Available ✓
- MD034 - Bare URL used
Other Link Rules
- MD011 - Reversed link syntax
- MD039 - Spaces inside link text
- MD042 - No empty links
- MD051 - Link fragments are valid
- MD052 - Reference links and images should use a label
- MD053 - Link and image reference definitions should be needed
- MD054 - Link and image style
- MD059 - Link and image reference style
Why Link Rules Matter
Proper link formatting:
- Ensures links are clickable in all renderers
- Improves accessibility with descriptive text
- Maintains consistent link style
- Prevents broken references
- Enhances document navigation
Common Link Formats
Inline Links
[Link text](https://example.com)
[Relative link](./other-page.md)
[Anchor link](#section-heading)
Reference Links
[Link text][reference]
[Another link][1]
[reference]: https://example.com
[1]: ./other-page.md
Autolinks
<https://example.com>
<user@example.com>
Quick Configuration
# .mdbook-lint.toml
# No configuration for MD034 - it auto-fixes bare URLs
# Disable specific link rules
disabled_rules = ["MD051", "MD052"]
Best Practices
- Use descriptive link text: Avoid "click here" or "link"
- Prefer relative paths: For internal documentation links
- Check anchors: Ensure heading anchors exist
- Use reference style: For frequently used URLs
- Wrap bare URLs: Use
<URL>
syntax or proper links
Related Categories
- mdBook Rules - mdBook-specific link validation
- Style Rules - General formatting rules