yzhang-gh / vscode-markdown

Markdown All in One
https://marketplace.visualstudio.com/items?itemName=yzhang.markdown-all-in-one
MIT License
2.93k stars 325 forks source link

GFM Alerts should be case insensitive to match GitHub #1390

Closed Unfocused closed 9 months ago

Unfocused commented 9 months ago

What's the problem

The matching of GFM Alerts is currently case-sensitive, only allowing uppercase:

> [!WARNING]
> Oh noes

[!WARNING] Oh noes

But GitHub doesn't care about the case the alert type (the word in the square brackets) - the matching is case insensitive.

What's the expected result

The following should also work:

> [!warning]
> Oh noes

[!warning] Oh noes

> [!WaRnInG]
> Oh noes

[!WaRnInG] Oh noes

Other information

markdown-it-github-alerts changed the default of case sensitivity to match GitHub in v0.3.0.

However, v0.2.0 added support for markdown-it v14, whereas it seems Markdown All in One currently uses v13 - I don't know if that's a problem or not.

An alternative is to keep using the current version of markdown-it-github-alerts (v0.1.2) and pass in a config object to explicitly set matchCaseSensitive to false. That'll be future-proof for whenever a newer version of the package is eventually used.

yzhang-gh commented 9 months ago

Thanks for the detailed information. We have already known this in #1389. However, there is a stange behavior in CI (which is about the version of markdown-it) so I didn't merge it in. I may be slow to respond as it is close to the Chinese new year. It would be great if someone could help.

Unfocused commented 9 months ago

Fixed: