mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2026-04-25 17:26:22 +03:00
[GH-ISSUE #402] MD044: Code blocks not being ignored when requested #2183
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#2183
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 @skyzyx on GitHub (Jun 4, 2021).
Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/402
0.27.1~0.23.1I run into this issue often where ignoring code blocks is sometimes followed, and sometimes not.
The proper case is: Docker
So this is wrong: docker
But should be okay in inline code blocks: On Amazon Linux 2,
overlay2is configured to use the default/var/lib/docker/overlay2directory, which is on the root filesystem.And also should be okay in fenced code blocks:
And also should be okay in un-fenced code blocks:
https://dlaa.me/markdownlint/#%25m%23%20Issue%20402%0A%0AThe%20proper%20case%20is%3A%20Docker%0A%0ASo%20this%20is%20wrong%3A%20docker%0A%0ABut%20should%20be%20okay%20in%20inline%20code%20blocks%3A%20On%20Amazon%20Linux%202%2C%20%60overlay2%60%20is%20configured%20to%20use%20the%20default%20%60%2Fvar%2Flib%2Fdocker%2Foverlay2%60%20directory%2C%20which%20is%20on%20the%20root%20filesystem.%0A%0AAnd%20also%20should%20be%20okay%20in%20fenced%20code%20blocks%3A%0A%0A%60%60%60systemd%0AAfter%3Dnetwork.target%20docker.service%0A%60%60%60%0A%0AAnd%20also%20should%20be%20okay%20in%20un-fenced%20code%20blocks%3A%0A%0A%20%20%20%20After%3Dnetwork.target%20docker.service%0A%0A%3C!--%20markdownlint-configure-file%20%7B%0A%20%20%20%20%22proper-names%22%3A%20%7B%0A%20%20%20%20%20%20%20%20%22names%22%3A%20%5B%0A%20%20%20%20%20%20%20%20%20%20%20%20%22Docker%22%0A%20%20%20%20%20%20%20%20%5D%0A%20%20%20%20%7D%2C%0A%20%20%20%20%22code_blocks%22%3A%20false%0A%7D%20--%3E%0A
@DavidAnson commented on GitHub (Jun 4, 2021):
Your example sets the parameter at the wrong scope (nesting). Fixing that gives the desired behavior: https://dlaa.me/markdownlint/#%25m%23%20Issue%20402%0A%0AThe%20proper%20case%20is%3A%20Docker%0A%0ASo%20this%20is%20wrong%3A%20docker%0A%0ABut%20should%20be%20okay%20in%20inline%20code%20blocks%3A%20On%20Amazon%20Linux%202%2C%20%60overlay2%60%20is%20configured%20to%20use%20the%20default%20%60%2Fvar%2Flib%2Fdocker%2Foverlay2%60%20directory%2C%20which%20is%20on%20the%20root%20filesystem.%0A%0AAnd%20also%20should%20be%20okay%20in%20fenced%20code%20blocks%3A%0A%0A%60%60%60systemd%0AAfter%3Dnetwork.target%20docker.service%0A%60%60%60%0A%0AAnd%20also%20should%20be%20okay%20in%20un-fenced%20code%20blocks%3A%0A%0A%20%20%20%20After%3Dnetwork.target%20docker.service%0A%0A%3C!--%20markdownlint-configure-file%20%7B%0A%20%20%20%20%22proper-names%22%3A%20%7B%0A%20%20%20%20%20%20%20%20%22names%22%3A%20%5B%0A%20%20%20%20%20%20%20%20%20%20%20%20%22Docker%22%0A%20%20%20%20%20%20%20%20%5D%2C%0A%20%20%20%20%20%20%20%20%22code_blocks%22%3A%20false%0A%20%20%20%20%7D%0A%7D%20--%3E%0A
@skyzyx commented on GitHub (Jun 4, 2021):
I had it right in my source code, but wrong in the markdownlint dingus. My bad.
Here is a better example: https://dlaa.me/markdownlint/#%25m%23%20Issue%20402%0A%0A*%20On%20Amazon%20Linux%202%2C%20%60overlay2%60%20is%20configured%20to%20use%20the%20default%20%60%2Fvar%2Flib%2Fdocker%2Foverlay2%60%20directory%2C%20which%20is%20on%20the%20root%20filesystem.%20This%20means%20your%20Docker%20%22storage%20pool%22%20is%20all%20available%20space%20on%20the%20root%20filesystem%3B%20there%20is%20not%20a%20separate%20volume%20for%20Docker.%20Instead%20of%20separate%20root%20and%20docker%20volumes%20of%208G%20and%2022G%2C%20there%20is%20now%20a%20single%2030G%20root%20volume.%0A%0A%3C!--%20markdownlint-configure-file%20%7B%0A%20%20%20%20%22proper-names%22%3A%20%7B%0A%20%20%20%20%20%20%20%20%22names%22%3A%20%5B%0A%20%20%20%20%20%20%20%20%20%20%20%20%22aws-vault%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%22Bash%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%22Circle%20CI%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%22Docker%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%22Dockerfile%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%22EditorConfig%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%22Git%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%22GitHub%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%22Golang%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%22Hugo%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%22JavaScript%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%22macOS%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%22Node%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%22Node.js%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%22Non-Prod%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%22npm%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%22PHP%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%22Prod%22%0A%20%20%20%20%20%20%20%20%5D%2C%0A%20%20%20%20%20%20%20%20%22code_blocks%22%3A%20false%0A%20%20%20%20%7D%0A%7D%20--%3E%0A
In this case, it appears to correctly detect the word "docker" about 10-ish words from the end of the line.
However, when performing the automated fix, it corrects the wrong instance of the word — the one inside the code blocks.
@DavidAnson commented on GitHub (Jun 8, 2021):
Simplified reproduction: https://dlaa.me/markdownlint/#%25m%23%20Issue%20402%0A%0Atext%20%60docker%60%20text%20docker%20text%0A%0A%3C!--%20markdownlint-configure-file%20%7B%0A%20%20%20%20%22proper-names%22%3A%20%7B%0A%20%20%20%20%20%20%20%20%22code_blocks%22%3A%20false%2C%0A%20%20%20%20%20%20%20%20%22names%22%3A%20%5B%0A%20%20%20%20%20%20%20%20%20%20%20%20%22Docker%22%0A%20%20%20%20%20%20%20%20%5D%0A%20%20%20%20%7D%0A%7D%20--%3E%0A