Reject uppercase in admonition type#356
Closed
almarouk wants to merge 1 commit intoebullient:mainfrom
Closed
Conversation
Reject uppercase in admonition type
ebullient
added a commit
that referenced
this pull request
Mar 28, 2026
Obsidian lowercases the data-callout attribute when rendering callouts, so types with uppercase letters would fail the admonitions[type] lookup. Instead of rejecting uppercase input, normalize to lowercase at storage time (addAdmonition) and in validateType for correct duplicate detection. Also migrate any existing uppercase types in userAdmonitions on load. Closes #356
4 tasks
Owner
|
Thanks for the report and the fix! I've gone with normalization instead of rejection — admonition types are now automatically lowercased at save time, which is consistent with how Obsidian already lowercases the |
ebullient
added a commit
that referenced
this pull request
Mar 28, 2026
Obsidian lowercases the data-callout attribute when rendering callouts, so types with uppercase letters would fail the admonitions[type] lookup. Instead of rejecting uppercase input, normalize to lowercase at storage time (addAdmonition) and in validateType for correct duplicate detection. Also migrate any existing uppercase types in userAdmonitions on load. Closes #356
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request Description
Uppercase letters shouldn't be allowed in admonition type. Otherwise, it will cause failure when checking if the callout/admonition is a custom one; for example in the following:
https://github.com/javalent/admonitions/blob/f19389940b0148b677e106f503980cbb9f767f63/src/callout/manager.ts#L57
Changes Proposed
Related Issues
Checklist