MD034 - no-bare-urls¶
Description¶
This rule is triggered when a URL or email address appears in the document without being enclosed in angle brackets, link syntax, or code spans. URLs using http, https, and ftp protocols are checked, as are email addresses with or without a mailto: scheme.
Text that is not rendered as Markdown (front matter, HTML blocks, HTML tag attributes, Hugo shortcodes, and reference definitions) is ignored, as are URLs that are already part of a link's text or an <a> element.
Fixable: Yes
Rationale¶
Without angle brackets, a bare URL or email address is not converted into a clickable link by some Markdown parsers. Wrapping URLs in angle brackets (<url>) or using proper link syntax ensures consistent rendering across different Markdown processors.
Examples¶
Invalid¶
# Document with Bare URLs
Visit https://www.example.com/ for more information.
Contact us at user@example.com for support.
Valid¶
# Document with Proper URLs
Visit <https://www.example.com/> for more information.
Contact us at <user@example.com> for support.
You can also use [example](https://www.example.com/) link syntax.
Not a clickable link: `https://www.example.com`
Reference: [https://example.com]
[example.com]: https://example.com