javalent / admonitions

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

Bug: Titles Parse Markdown? #123

Closed mpql closed 2 years ago

mpql commented 2 years ago

Weirdly, ordered and unordered lists are parsed inside Admonition titles. It seems other markdown is parsed as well; I'm not sure if this is a regression or just a previously undiscovered oversight, but I didn't find anything searching issues.

Steps to Reproduce:

```ad-note
title: 1. Borked Ordered List
title: - Borked Unordered List

**Expected Result:**

![image](https://user-images.githubusercontent.com/1709954/141440833-ceccb119-b647-4a57-89ec-559b40f5f87b.png)

**Actual Result:**

![image](https://user-images.githubusercontent.com/1709954/141440426-62c1983a-8994-4db6-851a-2ad349030624.png)

I *think* expected behavior would just be to not parse that kind of thing at all, but rather than being an isolated bug, I think this might be indicative of a larger issue of unexpecting parsing, per these tests with a code block:
title: ```
test
title: ```ad-note
test

...which result in:

![image](https://user-images.githubusercontent.com/1709954/141441503-8c00523b-e66c-45fb-8dc2-fdceb684b6fe.png)

Anyhow, there isn't much of a use case for this (I was trying to put steps in titles), and the following CSS fixes that:

```css
ol.admonition-title-content,
ul.admonition-title-content {
    list-style-position: inside;
    padding-left: 0;
}

...resulting in:

image

...which is kind of weird, but works fine. Just wanted to throw something up here to make it known / track it.

valentine195 commented 2 years ago

This is expected behavior. I can add a toggle if you’d rather not have markdown parsed.

mpql commented 2 years ago

Oh, that surprises me. But yeah, that sounds great -- as long as it's not troublesome!