Trying to hide code block

Hello, I just started using obsidian today as a notetaking app, I am trying to hide code block under a toggle which I followed from this example,

This is how I want it to look like in Visual Studio Code, but this is how it turns out in obsidian. The code block appears as a string instead of code block.

Am I doing something wrong? I really want this to work.

Thanks for reading!


This is not a direct answer to your question because I don’t know the limitations in working with markdown syntax inside html… I just know, by experience, that md syntax works inside a <span> tag.

But this is a suggestion: why not working with “Fold heading” or “Fold indent”? (Settings > Editor). With this you don’t need any html code, just .md syntax.

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