Folding applied on code block lines starting with "#"

Steps to reproduce

In Live Preview :

  • Create headings (H1, H2, etc…)
  • Create some code blocks containing some lines starting with a “#”
  • Fold all headings then unfold manually

Take note that you will need to fold/unfold headings multiple times in order to reproduce the bug. These steps have been reproduced in the Sandbox vault.

Expected result

  • Folding should not be applied on code block lines.

Actual result

  • You will see that folding is applied on the code block lines starting with a “#”

Environment

  • Operating system: Debian 11 bullseye
  • Debug info:
    SYSTEM INFO:
    Obsidian version: v0.14.15
    Installer version: v0.13.19
    Operating system: #1 SMP Debian 5.10.113-1 (2022-04-29) 5.10.0-14-amd64
    Login status: logged in
    Catalyst license: supporter
    Insider build toggle: off
    Live preview: on
    Legacy editor: off
    Base theme: dark
    Community theme: Atom
    Snippets enabled: 4
    Safe mode: off
    Plugins installed: 5
    Plugins enabled: 1
    1: Collapse All

Additional information

2 Likes

Please, post a screen recording of this happening in the sandbox vault and attach a copy of the document where this happens.

Here is a document :
Covenant.md (13.0 KB)

Here is a screencast :

Take note that the document differ from the screencast.
Also I was not able to reproduce the bug at first with only a small part of the document. So my guess is that this bug is probably related to long markdown notes.

Just let me know if you need something else.
Regards.

thanks

I confirm. There is a bug with the # symbol in the code block after folding.
Especially arbitrary unfolding after switching between tabs.

I’m also confirming this bug.

Hello, I also confirm the bug. It appears when using “fold all headings and list”, but if you click on a faulty header again to unfold/fold, it is then correct.