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

Extend blockquote alerts to support Obsidian types #12801

Closed
jakeprice-me opened this issue Aug 27, 2024 · 2 comments · Fixed by #12815
Closed

Extend blockquote alerts to support Obsidian types #12801

jakeprice-me opened this issue Aug 27, 2024 · 2 comments · Fixed by #12815

Comments

@jakeprice-me
Copy link

I've been trying out the new GitHub style alerts from #12590. Following the new documentation the alerts work great, thanks to @bep and @jmooring.

I have however noticed that the alert type's seem to be hardcoded to only accept a few preset types (the five mentioned in GitHub's alerts documentation) - which makes sense because this ticket was for exactly that!

It would be quite helpful if we could define additional alert types. I use Obsidian and this change is great because Obsidian does alerts the same way as GitHub, but supports a few more alert types, see here for the list (stuff like info, danger etc).

Would @bep consider adding functionality to allow the user to manually define their own alert types in config.yml?

@bep
Copy link
Member

bep commented Aug 27, 2024

This is the regexp in question:

(?i)^<p>\[!(NOTE|TIP|WARNING|IMPORTANT|CAUTION)\]

We HTML context here is the start of a blockquote in a render hook, so I suspect it would be more than specific enough if we made it slightly less specific...

/cc @jmooring

@bep bep added this to the v0.134.0 milestone Aug 29, 2024
@bep bep changed the title Support for Manually Defining GitHub Alert Types Extend blockquote alerts to support Obsidian Aug 29, 2024
@bep bep self-assigned this Aug 29, 2024
@bep bep added Enhancement and removed Proposal labels Aug 29, 2024
@bep bep changed the title Extend blockquote alerts to support Obsidian Extend blockquote alerts to support Obsidian types Aug 29, 2024
@bep bep added the S0 label Aug 29, 2024
@bep bep modified the milestones: v0.134.0, Unscheduled Aug 31, 2024
bep added a commit to bep/hugo that referenced this issue Sep 1, 2024
* Make the alert type parsing more flexible to support more types
* Add `AlertTitle` and `AlertSign` (for folding)

Note that GitHub will not render callouts with alert title/sign.

See https://help.obsidian.md/Editing+and+formatting/Callouts

Closes gohugoio#12805
Closes gohugoio#12801
bep added a commit to bep/hugo that referenced this issue Sep 1, 2024
* Make the alert type parsing more flexible to support more types
* Add `AlertTitle` and `AlertSign` (for folding)

Note that GitHub will not render callouts with alert title/sign.

See https://help.obsidian.md/Editing+and+formatting/Callouts

Closes gohugoio#12805
Closes gohugoio#12801
bep added a commit to bep/hugo that referenced this issue Sep 1, 2024
* Make the alert type parsing more flexible to support more types
* Add `AlertTitle` and `AlertSign` (for folding)

Note that GitHub will not render callouts with alert title/sign.

See https://help.obsidian.md/Editing+and+formatting/Callouts

Closes gohugoio#12805
Closes gohugoio#12801
@bep bep closed this as completed in #12815 Sep 1, 2024
@bep bep closed this as completed in e651d29 Sep 1, 2024
Copy link

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 23, 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.

3 participants