javalent / admonitions

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

Nesting Code-block Admonitions: Closing backticks (````) seems to be ignored in LP #228

Closed I-Pch closed 1 year ago

I-Pch commented 2 years ago

Hi there šŸ˜Š !

Playing around with nested code block Admonitions it seems that the closing backticks (`````) of the code-block are ignored in LP šŸ˜Š .

Test Environment

Test 1: Using the README Nested Admonitions Example

`````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.

#### šŸŸ  `Live Preview` result : 

The closing backticks ` ```` ` of the 2nd level code block admonition seem to be ignored when rendered in LP and the last line which should be included in the 1st level admonition is then left out...

<img width="661" alt="README Admonition - LP" src="https://user-images.githubusercontent.com/77828085/159260327-cd728478-7bed-40ee-ac9a-67f8a98535bb.png">

#### šŸŸ¢ `Reading` result:

The nested code block admonitions appear as expected.

<img width="661" alt="README Admonition - Reading" src="https://user-images.githubusercontent.com/77828085/159261027-2cd04369-9444-4c5c-b7fe-882c755b6a2a.png">

####  šŸŸ  `Live Preview` vs. šŸŸ¢ `Reading` results

<img width="1356" alt="README nested Admonitions - LP vs Reading" src="https://user-images.githubusercontent.com/77828085/159264001-57a37252-2940-4d8a-ba69-f95fa705e428.png">

## Test 2: Using 2 Admonitions I created through the plugin

`ad-nav` and `ad-ephemeris` both have the setting `No Admonition Title by Default` toggled `ON`. 
Something...

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

Back to the 1st level admonition ...

šŸŸ  Live Preview result :

Same as before, the closing backticks ``` of the ```ad-ephemeris are ignored and the last line which should be rendered within the 1st level admonition is left out ...

Nested code block Admonitions - LP

šŸŸ¢ Reading result:

The nested Admonitions are displayed as expected šŸ˜Š

Nested code block Admonitions - Reading
BrayanDSO commented 2 years ago

Here the same happens on Admonition 7.0.4 (I can't update to obsidian 0.14+ yet)

I-Pch commented 2 years ago

@BrayanDSO : I honestly didn't know that, as I almost never use code block Admonition (I switched to MS Docs syntax admonition when it was available and before Obsidian v.0.14.0 was released).

cumany commented 2 years ago

Maybe turn this off and the problem seems to be solved image

RaitaroH commented 1 year ago

I seem to have the issue now as well. Obsidian v1.0.0 Admonition 9.0.5 Markdown Syntax highlighting disabled.

Not sure if relevant to this, or a new issue has to be opened, but in preview mode there is no padding.

image image