Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MD028: Add specific handling of GitHub-style callouts #1331

Closed
volker-raschek opened this issue Aug 19, 2024 · 3 comments
Closed

MD028: Add specific handling of GitHub-style callouts #1331

volker-raschek opened this issue Aug 19, 2024 · 3 comments
Labels

Comments

@volker-raschek
Copy link

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:

# Title

> [!TIP] You can use a container image mirror [germany - west](https://example.com) to increase the download speed.

> [!WARNING]
> Please do not use the latest image, because ...

Tip

You can use a container image mirror germany - west to increase the download speed.

Warning

Please do not use the latest image, because ...

Please adapt MD028 to allow nested callouts by default or implement a setting to allow it generally.

@DavidAnson DavidAnson changed the title MD029: Not in line with Markdown callouts MD028: Add specific handling of GitHub-style callouts Aug 19, 2024
@DavidAnson
Copy link
Owner

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
Copy link
Author

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.

Bildschirmfoto vom 2024-08-19 18-47-00

I have a container image with markdownlint 0.41.0, which I use for the demo:

$ cat > /tmp/README.md <<EOF
# Title

> [!NOTE]
> NOTE

> [!TIP]
> TIP

EOF

$ docker run --rm --volume /tmp:/tmp docker.io/volkerraschek/markdownlint:0.41.0 /tmp/README.md 
/tmp/README.md:5 MD028/no-blanks-blockquote Blank line inside blockquote

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?

$ cat > /tmp/README.md <<EOF
# Title

> [!NOTE]
> NOTE

> [!TIP]
> TIP

Hello

> World

> Foo Bar
EOF

$ docker run --rm --volume /tmp:/tmp docker.io/volkerraschek/markdownlint:0.41.0 /tmp/README.md 
/tmp/README.md:12 MD028/no-blanks-blockquote Blank line inside blockquote

@DavidAnson
Copy link
Owner

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.

@DavidAnson DavidAnson closed this as not planned Won't fix, can't repro, duplicate, stale Oct 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants