javalent / admonitions

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

Nesting Code-block Admonitions - Custom Callouts troubles... #227

Closed I-Pch closed 2 years ago

I-Pch commented 2 years ago

Hi there 😊 !

I was again trying to nest 2 admonitions/custom callouts but I'm having some troubles with that 😊 ...

The admonitions I created through the plugin and used for my tests here are both supposed to display no type and not title (which works perfectly with the native Obsidian Callout syntax when I'm not trying to nest them in a note 🙌 )

Here are the things I tried on Mac + Obsidian v0.14.2 + Admonition 8.2.3 (No Community theme)

1. Nested Code-Block Admonitions

🟠 It seems to fail in LP : The closing ````` of the 1st level code block admonition seems to be ignored when rendered in LP. I've tested this with the code block example from the README and my admonitions/custom callouts created through the plugin with the same result 😊

`````ad-note
title: Nested Admonitions
collapse: open

Hello!

````ad-note
title: This admonition is nested.
This is a nested admonition!

```ad-warning
title: This admonition is closed.
collapse: close

This is in the original admonition.
Which looks like this in `LP` 🟠 
<img width="661" alt="README Admonition - LP" src="https://user-images.githubusercontent.com/77828085/159242629-2d3e6f68-d670-4370-a7ba-a261ddaf14aa.png">

And like this in `Reading` 🟢  
<img width="661" alt="README Admonition - Reading" src="https://user-images.githubusercontent.com/77828085/159243106-962deba3-989f-49c4-a737-4c496f73cb3e.png">

And for the Admonitions I created through the plugin
(The setting `No Admonition Title by Default` is toggled `ON` for both `ad-nav` & `ad-ephemeris`)
Something...

And another Admonition...
```ad-ephemeris
Something else

Back to the 1st level admonition ...

It gives me this in LP 🟠

Nested code block Admonitions - LP

And this in Reading 🟢

Nested code block Admonitions - Reading

Note

I'm a big fan of the new native Obsidian callouts syntax and I don't wish to use code-block admonitions 😊. Since the now gone MS Docs syntax was introduced in the plugin, I never used any other available syntax 😊, so I'm all for creating custom callouts through the plugin and using them with the native Obsidian callouts syntax. I ran the tests with the code blocks Admonitions to see if what I wanted to do was somehow feasible or not... And the result I'm looking for here using my custom callouts with the native Obsidian callouts syntax in LP is indeed the one I get in Reading with the nested code block admonitions 😇

2. Nested Admonitions using the native Obsidian Callouts syntax

> [!nav] 
> Something
> 
> And another "Custom Callout"
> > [!ephemeris] 
> > Something else...
> 
> Back to the 1st level admonition ...

It definitively works in LP and Reading with the exception that, for some reasons, the toggled ON setting No Admonition Title by Default seems to be ignored for the nested Admonition/custom callout (> > [!ephemeris]) but it works for the 1st level Admonition/custom callout (> [!nav]) without any problem ... (The setting is also taken in to account when those 2 custom callouts (using the native Obsidian callouts syntax) are not nested and placed in my notes one after the other)

Custom Callouts - Obsidian Syntax - LP

After all this...

As I'm trying to get this result 👇 (Reading + code block admonition)

Nested code block Admonitions - Reading

... but with the native Obsidian callouts syntax ... I guess my question is : Would there be any 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 override the Obsidian callout CSS ? 😇 (same goes for the drop-shadow 😇 ... which seems to work in block code admonition but not with Obsidian callouts syntax, as mentioned in #222 )

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

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

valentine195 commented 2 years ago

Can you make multiple issues for the different problems?

I-Pch commented 2 years ago

Sure 😊 !

but what do you mean ?

One issue for the nested code block problem, one for the nested custom callouts and one for the drop-shadows ?

Or just one for the nested problems (code block + custom callouts) and one for the drop-shadows ?

valentine195 commented 2 years ago

One issue for the nested code block problem, one for the nested custom callouts and one for the drop-shadows

This one, but the drop shadow issue already exists, no need to make another one 😃

I-Pch commented 2 years ago

Ok 😁 ! I'm on it 😁 !