[GH-ISSUE #730] MD040: Create a config to allow other content #524

Closed
opened 2026-03-03 01:27:40 +03:00 by kerem · 1 comment
Owner

Originally created by @Dentrax on GitHub (Feb 28, 2023).
Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/730

https://github.com/DavidAnson/markdownlint/blob/main/doc/md040.md documentation says:

"Info strings with leading/trailing whitespace (ex: js ) or other content (ex: ruby startline=3) will trigger this rule."

I want to use this rule, but I have the following:

yaml mdox-exec="go run autogendocs.go"

So linter says:

MD040/fenced-code-language Fenced code blocks should have a language specified [Info string contains more than language: "yaml mdox-exec="go run autogendocs.go""]

What is the workaround? Should I have to disable this?

Originally created by @Dentrax on GitHub (Feb 28, 2023). Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/730 https://github.com/DavidAnson/markdownlint/blob/main/doc/md040.md documentation says: > _"Info strings with leading/trailing whitespace (ex: js ) or other content (ex: ruby startline=3) will trigger this rule."_ I want to use this rule, but I have the following: `yaml mdox-exec="go run autogendocs.go"` So linter says: ``` MD040/fenced-code-language Fenced code blocks should have a language specified [Info string contains more than language: "yaml mdox-exec="go run autogendocs.go""] ``` What is the workaround? Should I have to disable this?
kerem 2026-03-03 01:27:40 +03:00
  • closed this issue
  • added the
    question
    label
Author
Owner

@DavidAnson commented on GitHub (Feb 28, 2023):

Per the documentation you link, info strings will only be blocked if the "language_only" parameter is set to true. That is not the default, so if you were doing so that's why it's being reported.

As you can see in the demo, your example does not warn by default: https://dlaa.me/markdownlint/#%25m%23%20Issue%20730%0A%0A%60%60%60yaml%20mdox-exec%3D%22go%20run%20autogendocs.go%22%0Avalue%3D5%0A%60%60%60%0A

<!-- gh-comment-id:1448551171 --> @DavidAnson commented on GitHub (Feb 28, 2023): Per the documentation you link, info strings will only be blocked if the "language_only" parameter is set to true. That is not the default, so if you were doing so that's why it's being reported. As you can see in the demo, your example does not warn by default: https://dlaa.me/markdownlint/#%25m%23%20Issue%20730%0A%0A%60%60%60yaml%20mdox-exec%3D%22go%20run%20autogendocs.go%22%0Avalue%3D5%0A%60%60%60%0A
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#524
No description provided.