javalent / admonitions

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

Nesting Custom Callouts: the setting "No Admonition Title by Default" seems to be ignored when using the native Obsidian Callouts syntax #229

Closed I-Pch closed 1 year ago

I-Pch commented 2 years ago

Hi there again 😊 !

I'm trying to create nested custom callouts (i.e.: admonitions used with the native Obsidian Callouts Syntax) but, for some reasons, the setting No Admonition Title by Default seems to be ignored for the nested custom callout which therefore, renders the type/title of the custom callout even with No Admonition Title by Default toggled ON...

Test Environment

Custom Callouts settings

1. > [!nav]

(the setting Admonition Title is empty)

nav

2. > [!ephemeris]

(the setting Admonition Title is also empty)

ephemeris

Test 1: Used one after the other in a note

> [!nav]
> Here's the `[!nav]` custom callout

> [!ephemeris]
> Here's the `[!ephemeris]` custom callout

🟢 Result

They are rendered in LP and Reading as desired (no icon, type/title) as I didn't precise any title and didn't make them collapsable...

Nav and Eph - LP

Test 2: Nesting [!ephemeris] within [!nav]

> [!nav]
> Here's the `[!nav]` custom callout
> 
> And another "Custom Callout"
> > [!ephemeris]
> > Here's the `[!ephemeris]` custom callout
> 
> Back to `[!nav]` ...

🟠 Result

The toggled ON setting for No Admonition Title by Default of [!ephemeris] seems to be ignored but it still works for the 1st level custom callout [!nav].

Nested ephemeris within nav - LP

Expected result

Nesting [!ephemeris] within [!nav] using the native Obsidian callout syntax, I was hoping to get the same result I can get in Reading when nesting them using the Admonition code block syntax 😊 .

Nested code block Admonitions - Reading

I don't know if this would be feasible but maybe there could be a way to force the No Admonition Title by Default for the nested custom callouts to be taken into account by Obsidian ? 🤔

Couldn't this setting be added to the Admonition CSS snippet so it potentially overrides the Obsidian callout CSS ? 😇

I have no idea how to do that 😅 ... hence why I'm here 😊...

I'm sorry for the length 😇 ... But I thank you very much in advance for any help 😁 !

Cammagno commented 2 years ago

I don't know if this would be feasible but maybe there could be a way to force the No Admonition Title by Default for the nested custom callouts to be taken into account by Obsidian ?

Same issue for me, and same wish :)

An interesting "trick", that according to me provides a rather satisfying visual effect (as a temporary partial workaround), is that if you put a - as title of the nested admonition (for example >>[!Eccezione] - ), the content of the admonition is rendered as a bullet line inside the "title" colored bar, but without the normal formatting of the title (for example the bold):

Admonitions - Nested

Aradoexis commented 9 months ago

I have this problem too.