javalent / admonitions

Adds admonition block-styled content to Obsidian.md
MIT License
1.08k stars 72 forks source link

fix: mixed case custom callout types are supported #295

Closed nathonius closed 1 year ago

nathonius commented 1 year ago

This has at least been a bug since #252.

Custom admonition types that include uppercase letters do not work with callouts. Callouts are always rendered with a lowercase type, for example:

> [!Exercise] Sharpen your pencil
> My custom callout!

Is rendered in html as:

<div data-callout-metadata="" data-callout-fold="" data-callout="exercise" class="callout"><div class="callout-title">

So unless the custom admonition type is lowercase, the css snippet won't work and the default callout styles are used. This change simply converts the type to lowercase before updating the css snippet.