MD034 - Bare URL used --> false positive for Reference Links with comment block
See original GitHub issueOn my Jekyll blog, I use often link references to group the long URLs at the end of the post. I start the block with {% comment %}<!-- Link References -->{% endcomment %}
Works no MD034:
[MD034][ref001]
[ref001]: https://github.com/DavidAnson/markdownlint/blob/master/doc/Rules.md#md031---fenced-code-blocks-should-be-surrounded-by-blank-lines
[ref002]: https://github.com
[ref003]: https://github.com/DavidAnson
False positive of MD034, I got the warning because of my comment line:
[MD034][ref001]
{% comment %}<!-- Link References -->{% endcomment %}
[ref001]: https://github.com/DavidAnson/markdownlint/blob/master/doc/Rules.md#md031---fenced-code-blocks-should-be-surrounded-by-blank-lines
[ref002]: https://github.com
[ref003]: https://github.com/DavidAnson
Workaround of MD034, add a empty line between comment and list of references:
[MD034][ref001]
{% comment %}<!-- Link References -->{% endcomment %}
[ref001]: https://github.com/DavidAnson/markdownlint/blob/master/doc/Rules.md#md031---fenced-code-blocks-should-be-surrounded-by-blank-lines
[ref002]: https://github.com
[ref003]: https://github.com/DavidAnson
Is there a way to get ride of the MD034 warning, without the empty line?
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
Markdownlint - Visual Studio Marketplace
Extension for Visual Studio Code - Markdown linting and style checking for Visual Studio Code.
Read more >markdownlint - npm
A Node.js style checker and lint tool for Markdown/CommonMark files.. Latest version: 0.26.2, last published: 20 days ago. Start using ...
Read more >markdownlint | Yarn - Package Manager
A Node.js style checker and lint tool for Markdown/CommonMark files. npm version License. Install. npm install markdownlint --save-dev. Overview.
Read more >markdownlint-cli2.cjs - mui/material-ui - Sourcegraph
We use it from time to time, it's fine. MD034: false, // MD034/no-bare-urls. Not a concern for us, ... MD052: false, // MD052/reference-links-images....
Read more >Fix most instances of bare URLs in markdown - GitLab
What does this MR do? Changes most instances of bare URLs (that aren't wrapped) to use < > for true URLs,...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The braces around the links aren’t valid for reference links https://spec.commonmark.org/0.29/#reference-link. They should just be the value inside the braces if it wasn’t a reference link
That’s a good observation, thanks @nschonni. Though it doesn’t affect the behavior here and I think it’s by design per my comment above.