Bug: Markdown Table within Details

Consider the following cell:

md`
<details>
<summary> Foo </summary>

| Table | Example |
| -- | -- |
| one | 1 |
| two | 2 |
</details>`

When the details are expanded, I expect it to render a table, like Discourse does:

Foo
Table Example
one 1
two 2

Instead, it renders the raw text, like so:

See a live repro here: https://observablehq.com/@decentralion/details-in-table-bug-reproduction

This happens because Observable’s standard library is using version 0.3.12 of marked, check these demo links (v0.3.12)(v0.4.0) on the marked library homepage.

There was previously a thread about problems that occured when upgrading the version of marked, but maybe the team will revisit it at some point.

1 Like

Thanks for the context @bgchen.

Here’s a workaround, by the way:

md`# Bug Repro: Table in Details


<details>
<summary> Foo </summary>

${md`
| Table | Example |
| -- | -- |
| one | 1 |
| two | 2 |`}
</details>`
2 Likes