obsidian-fold-bug.zip (3.9 KB)
Steps to reproduce
- Open the Obsidian Sandbox vault.
- Extract the attached zip and copy all
.mdfiles into the Sandbox vault folder. - Open
parent.md. It opens in Reading mode (set via frontmatter). - Click the fold arrow next to the heading `# 6. Section Six` (which contains a markdown link to an external URL — see the attached parent.md).
- Open another note, then reopen
parent.md.
Did you follow the troubleshooting guide? [Y]
Expected result
Only the # 6. section should be visually folded.
Actual result
Two separate visual regions are folded:
(1) The # 6. section itself (correct).
(2) An item inside the ![[child-5#Section A]] embed (incorrect — this content belongs to a different # N section and should not be affected).
Crucially, the stored fold state contains only a single range. Running the following in the developer console:
app.foldManager.load(app.workspace.getActiveFile())
returns:
{ folds: [{ from: 28, to: 32 }] }
This single range correctly identifies only the # 6. section. So a single stored fold range is being applied to multiple visual locations during the Reading mode rendering.
Additional pattern observed by folding each # N heading individually:
- Folding
# 0,# 1,# 2,# 7,# 8: no extra misfold. - Folding
# 3,# 4,# 5: one extra misfold inside thechild-1embed, at the ordered list item with the matching number. - Folding
# 6: one extra misfold inside thechild-5embed at an unrelated position.
Environment
SYSTEM INFO:
Obsidian version: 1.12.7
Installer version: 1.12.7
Operating system: Windows 11 Home 10.0.26200
Login status: logged in
Language: ko
Catalyst license: insider
Insider build toggle: on
Live preview: on
Base theme: adapt to system
Community theme: none
Snippets enabled: 0
Restricted mode: on
RECOMMENDATIONS:
none
Additional information
- Reproduces in: Sandbox vault, Restricted mode, default theme, no CSS snippets, no community plugins enabled.
- The minimal reproduction files are attached as a zip. README.md inside the zip describes the same steps.
- The bug was first noticed in a larger production vault where folding
# 6.caused two extra misfolds across two different embeds. The simplified English reproduction case attached here triggers only one extra misfold, but the underlying issue (a single stored fold range applied to multiple visual locations) is identical.