Fold/Unfold list in code blocks (Reading view)

Hi! I’m new in Obsidian and I’m preparing my own setup.
It would be very helpful if it were possible to fold/unfolf lists in the blocks code (in reading view), as is done in normal text.

I noticed that in the live preview mode the symbols to fold/unfold the lists appear in a code block, while in the reading view they do not.

Is there a plugin or a css snippets to fix this? I am also willing to “break” the code blocks appearance at all, as I don’t use Obsidian for this.

I’m using Obsidian’s default dark theme, and I see this symbol. Did you try with another theme? There’s no reason this wouldn’t be seen in Reading view.

Cheers, Marko :nerd_face:

Thanks for reply.
I tried default dark mode, but nada.
I repeat to avoid confusion: I am referring to a list within a code block.
Does foldini/unfoldin list nested items work for you?
Maybe you have some specific plugin or CSS snippet enabled?

So I tested with the following text:

Normal text...

```
- list item 1
- list item 2
  - list item 2.1
  - list item 2.2
- list item 3
```

And surely it can be folded in live preview, but not reading mode.

I reckon that is to be expected as a code block is normally not meant to be foldable. I can see this behaviour for both a markdown and a javascript code block. I guess it can be explained with live preview and reading mode having different syntax highlight engines.

Thanks for reply.

Blockquote I guess it can be explained with live preview and reading mode having different syntax highlight engines.

If it is as you think, do you think it is possible to change this behavior in the reading mode with a plugin or css snippets?

I ask because I really don’t know much about Java or the “Obsidian engine”, so I want to understand if I should put my mind at peace and move on to another idea.

I’m not sure, but I do believe it’s going to be hard to find a plugin or some CSS being able to do folding within a code block as long as prism.js (the syntax highlighter for reading mode) doesn’t do it by default.

Thanks again.
I hope in another solution, if any.