observablehq / feedback

Customer submitted bugs and feature requests
42 stars 3 forks source link

Markdown doesn't work within <details> <summary> html tags #310

Closed hellonearthis closed 2 years ago

hellonearthis commented 2 years ago

I have a markdown cell and when I try to use the html detail tag, like below.

<details>
<summary>
# An H1 html title
</summary>
> things about this title
- one
- two
</details>

The markdown is ignored and treated like plain text.

mbostock commented 2 years ago

Within HTML you are only allowed to use inline Markdown elements such as italics (*), bold (**), and links. You aren’t allowed to use block elements such as headings (#), blockquotes (>), and lists (-). If you want these elements within HTML, you should write them as HTML. Alternatively you can interpolate Markdown into Markdown, but that’s probably more awkward than just writing HTML.

<details>
<summary>
${md`# An H1 html title`}
</summary>
${md`> things about this title
- one
- two`}
</details>
hellonearthis commented 2 years ago

That's cool, I was just dreaming of an easier way that the simple way you mentioned or just using HTML.