mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2026-04-25 09:16:02 +03:00
[GH-ISSUE #1331] MD028: Add specific handling of GitHub-style callouts #2509
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#2509
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 @volker-raschek on GitHub (Aug 19, 2024).
Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/1331
Hello everyone,
GitHub has introduced Markdown callouts in the past. These are or have already been adopted by other VCSs - for example by Gitea. In this issue are all callouts as example defined.
If I now write several callouts in a row, this violates the MD028 rule. I understand the rule and would like to keep it, but there should be an exception for a callout.
Example of callout nesting:
Please adapt MD028 to allow nested callouts by default or implement a setting to allow it generally.
@DavidAnson commented on GitHub (Aug 19, 2024):
As you show, the GitHub parser does not merge consecutive block quotes, so the rationale of MD028 does not apply there. Why not disable the rule?
@volker-raschek commented on GitHub (Aug 19, 2024):
Well, that's not true. I use in VSCode the markdownlint extention v0.55.0. The point at which MD028 is violated is marked in yellow.
I have a container image with markdownlint 0.41.0, which I use for the demo:
Sure, I can simply deactivate the rule, but the rule would change the behavior of normal block quotes, too. This is not what I want.
The question I am asking myself is, how can a set of rules be implemented that validates the following Markdown as invalid with MD028 for non GitHub-style collouts?
@DavidAnson commented on GitHub (Aug 19, 2024):
I may not have been clear. What I was pointing out is that GitHub does not seem to merge consecutive block quotes that are separated by an empty line. This appears to be the case whether or not they are callouts. Rule MD028 exists to warn people about the problem of unexpected behavior for parsers that DO merge, but GitHub does not seem to be such a parser and therefore the rule does not seem necessary in that context. I propose that you can disable MD028 for GitHub scenarios regardless of whether callouts are being used.