question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

MD034 - Bare URL used --> false positive for Reference Links with comment block

See original GitHub issue

On 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:closed
  • Created 3 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
nschonnicommented, Apr 26, 2020

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

0reactions
DavidAnsoncommented, Apr 28, 2020

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found