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

Hugo alert heading is case-sensitive and upper case only ([!NOTE]), but GitHub Alert Markdown extension is case-insensitive ([!note]) #12767

Closed
KoolTechTricks opened this issue Aug 14, 2024 · 2 comments · Fixed by #12768
Assignees

Comments

@KoolTechTricks
Copy link

What version of Hugo are you using (hugo version)?

$ hugo version
hugo v0.132.1+extended linux/amd64 BuildDate=unknown

Does this issue reproduce with the latest release?

Yes


Alerts are introduced in Hugo v0.132.0. Documentation says that syntax is compatible with GitHub Alert Markdown extension. However, GitHub allows writing alert heading in lower case, while Hugo doesn't.

> [!note]
> Example

Note

Example

Hugo won't render [!note], or [!Note], or [!nOtE] as alert while GitHub will.

Probably need to change this regex filter:

var gitHubAlertRe = regexp.MustCompile(`^<p>\[!(NOTE|TIP|WARNING|IMPORTANT|CAUTION)\]`)

@bep
Copy link
Member

bep commented Aug 14, 2024

Hugo won't render [!note], or [!Note], or [!nOtE] as alert while GitHub will.

Well, one could argue that the bug lives in GitHub's implementation, because their spec says nothing about casing, but their examples all indicate ... upper case:

https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#alerts

... but I guess we can adjust our regexp ...

Note

Hmm ...

Copy link

github-actions bot commented Sep 5, 2024

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 5, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants