mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2026-04-26 09:46:01 +03:00
[GH-ISSUE #500] MD034 should not trigger when link exists inside a code block #2255
Labels
No labels
bug
enhancement
enhancement
enhancement
fixed in next
fixed in next
fixed in next
new rule
new rule
new rule
pull-request
question
refactoring
refactoring
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/markdownlint#2255
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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'.
@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
@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.