[GH-ISSUE #500] MD034 should not trigger when link exists inside a code block #2255

Closed
opened 2026-03-07 20:06:02 +03:00 by kerem · 2 comments
Owner

Originally created by @ReneRebsdorf on GitHub (Feb 12, 2022).
Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/500

Let me know if this is supposed to go into the super-linter issue tracker, but my best guess was it was relevant here.

As markdown can contain code blocks, which could include a curl or similar, a bare url is needed.
Our current workaround is to disable testing of the entire file, where we only need it excluded within code blocks.

While this test is valid if the code block is markdown, I'd say testing of MD034 inside code blocks should be excluded, or at least validated that the code block is tagged as 'markdown'.

Originally created by @ReneRebsdorf on GitHub (Feb 12, 2022). Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/500 Let me know if this is supposed to go into the super-linter issue tracker, but my best guess was it was relevant here. As markdown can contain code blocks, which could include a curl or similar, a bare url is needed. Our current workaround is to disable testing of the entire file, where we only need it excluded within code blocks. While this test is valid if the code block is markdown, I'd say testing of MD034 inside code blocks should be excluded, or at least validated that the code block is tagged as 'markdown'.
kerem 2026-03-07 20:06:02 +03:00
  • closed this issue
  • added the
    question
    label
Author
Owner

@DavidAnson commented on GitHub (Feb 12, 2022):

Please show an example? MD034 does not warn for bare URLs in code spans, blocks, or fences as seen here: https://dlaa.me/markdownlint/#%25m%23%20Issue%20500%0A%0AText%20%60https%3A%2F%2Fexample.com%60%0A%0A%60%60%60text%0Ahttps%3A%2F%2Fexample.com%0A%60%60%60%0A%0A%20%20%20%20https%3A%2F%2Fexample.com%0A

<!-- gh-comment-id:1037528560 --> @DavidAnson commented on GitHub (Feb 12, 2022): Please show an example? MD034 does not warn for bare URLs in code spans, blocks, or fences as seen here: https://dlaa.me/markdownlint/#%25m%23%20Issue%20500%0A%0AText%20%60https%3A%2F%2Fexample.com%60%0A%0A%60%60%60text%0Ahttps%3A%2F%2Fexample.com%0A%60%60%60%0A%0A%20%20%20%20https%3A%2F%2Fexample.com%0A
Author
Owner

@ReneRebsdorf commented on GitHub (Feb 12, 2022):

@DavidAnson You are absolutely right! I had made a mistake in my conclusion when debugging linters as I was going through some of our file-wide disables.

Sorry for the noise - this was actually caused by a violation outside of a code block that I had missed when I was going through our md docs.

<!-- gh-comment-id:1037542429 --> @ReneRebsdorf commented on GitHub (Feb 12, 2022): @DavidAnson You are absolutely right! I had made a mistake in my conclusion when debugging linters as I was going through some of our file-wide disables. Sorry for the noise - this was actually caused by a violation outside of a code block that I had missed when I was going through our md docs.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/markdownlint#2255
No description provided.