[GH-ISSUE #120] MD040 - fenced-code-language - Fenced code blocks should have a language specified #1950

Closed
opened 2026-03-07 20:03:03 +03:00 by kerem · 3 comments
Owner

Originally created by @V0d01ey on GitHub (May 8, 2018).
Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/120

Why the rule MD040 is introduced?

Why not using "code block" without syntax highlighting?
It is a simple useful marking for a preformatted text without indenting.

Originally created by @V0d01ey on GitHub (May 8, 2018). Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/120 Why the rule MD040 is introduced? Why not using "code block" without syntax highlighting? It is a simple useful marking for a preformatted text without indenting.
kerem 2026-03-07 20:03:03 +03:00
  • closed this issue
  • added the
    question
    label
Author
Owner

@DavidAnson commented on GitHub (May 8, 2018):

Correct syntax highlighting is usually clearer for the reader than without it, so this rule helps remind authors to add a language. If you do not want to do that, the rule can be disabled OR 4-space indenting can be used to create the code block instead.

<!-- gh-comment-id:387290242 --> @DavidAnson commented on GitHub (May 8, 2018): Correct syntax highlighting is usually clearer for the reader than without it, so this rule helps remind authors to add a language. If you do not want to do that, the rule can be disabled OR 4-space indenting can be used to create the code block instead.
Author
Owner

@dhimmel commented on GitHub (Aug 27, 2019):

I always specify a language when there is one, but not sure what to specify when there is no corresponding language? For example, log output or help messages? Is there a language that can be specified which means no-syntax-highlighting?

<!-- gh-comment-id:525417488 --> @dhimmel commented on GitHub (Aug 27, 2019): I always specify a language when there is one, but not sure what to specify when there is no corresponding language? For example, log output or help messages? Is there a language that can be specified which means no-syntax-highlighting?
Author
Owner

@DavidAnson commented on GitHub (Aug 27, 2019):

@dhimmel, Usually “text” doesn’t do any highlighting.

<!-- gh-comment-id:525455894 --> @DavidAnson commented on GitHub (Aug 27, 2019): @dhimmel, Usually “text” doesn’t do any highlighting.
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#1950
No description provided.