How to make collapsible code?

Things I have tried

What I’m trying to do

I’m trying to have collapsible code blocks. But:

<details>
<summary>Code</summary>
// code block surrounded by triple back-ticks
</details>

does not work

From looking at this thread: Folding in preview - #128

it seems like code blocks don’t work inside collapsible sections. Is there a good workaround?

Hi.

You do not consider use the option “Fold heading” or “Fold indent” instead of html code?

Obsidian > Settings > Editor

4 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.