MD054 - link-image-style¶
Description¶
This rule checks that links and images in Markdown follow a consistent style. Links and images can use inline syntax, reference syntax (full, collapsed, or shortcut), or autolink syntax. The rule can be configured to allow or disallow specific styles.
Rationale¶
Consistent formatting makes it easier to understand a document. Autolinks are concise but appear as raw URLs. Inline links include descriptive text but take more space. Reference links are easier to read in Markdown source but require separate definitions.
Configuration¶
autolink-
Allow autolinks (e.g.,
<https://example.com>).- Default:
true
- Default:
inline-
Allow inline links and images.
- Default:
true
- Default:
full-
Allow full reference links and images (e.g.,
[text][ref]).- Default:
true
- Default:
collapsed-
Allow collapsed reference links and images (e.g.,
[ref][]).- Default:
true
- Default:
shortcut-
Allow shortcut reference links and images (e.g.,
[ref]).- Default:
true
- Default:
url_inline-
Allow URLs as inline links (e.g.,
[https://...](https://...)).- Default:
true
- Default:
Examples¶
Invalid¶
# Invalid Link Style
<https://example.com>
[inline link](https://example.com)
Valid¶
# Valid Link Styles
This document uses inline links [like this](https://example.com).
Here is an .
Reference links [like this][ref] are also used.
[ref]: https://example.com