"Fold All" command misbehaves with Nested lists in Editor mode

Steps to reproduce

Steps:

  1. Write a nested numbered list with 4 levels of list. The exact list I used is available on Pastebin here.
  2. Given the list is huge, it makes sense to use “Fold all headings and lists” command. Press “Ctrl + P” and find this command to use it.
  3. As espected, all the headings and nested lists are folded.
  4. Now, go to Reading Mode. The headings and lists will remain folded as expected.
  5. Unfold only the first level of headings and lists. It will show perfectly in Reading Mode (Refer attachments: screenshot 1 shows this on the right side.)
  6. Switch back to Editor mode (i.e., Source-code mode). The lists/headings should appear as they did in Reading Mode, but some of the lists don’t appear unfolded till the first level that was expected. (screenshot 1 shows this on the left side.)
  7. I can unfold them in Editor mode on by one manually too, but it is time consuming since my list is huge. Doing it manually works (screenshot 2 which is expected behaviour for “Fold All” feature as well".

Did you follow the troubleshooting guide? [Y/N]

Please, follow the Troubleshooting Guide before answering Yes.

Yes. I tested this in sandbox. Screenshots are from the same sandbox.

Expected result

The lists must appear unfolded till one level in the Editor mode, same as they appear in the Reading Mode.

Actual result

The lists appear unfolded till one level in the Reading Mode, but some of the lists don’t appear unfolded till the first level despite them being unfolded in the Reading Mode.

Environment

SYSTEM INFO:
Obsidian version: 1.12.7
Installer version: 1.5.11
Operating system: Windows 10 Home Single Language 10.0.22631
Login status: not logged in
Language: en-GB
Insider build toggle: off
Live preview: on
Base theme: light
Community theme: none
Snippets enabled: 0
Restricted mode: on

RECOMMENDATIONS:

The behaviour should be the same in the Reading Mode as well as Editor mode, since we usually read in Reading Mode, if we want to edit something we quickly switch to Editor mode to edit something.

I don’t think the user should be expected to unfold lists and find the exact place where s/he wanted to make the edit.


Additional information

Attachments

screenshot 1 (after using Fold All command)

screenshot 2 (after manually folding each nested list)

Duplicate of