Blockmath breaks the rest of the note if dollars are placed in particular way

Steps to reproduce

Place the second $$ of random blockmath on newline without any additional text. Place some headings after this blockmath and observe reading mode, links to these headings and outline break at once.
P.S. Read this post further for details, I beg you, please. This is a bit hard to explain in text.

Did I follow the troubleshooting guide? Yes

I also attached the sandbox vault with reproduced bug and all the details. Read further for the description of the sandbox vault.

Obsidian Sandbox.zip (268.5 KB)

Expected result

Properly displayed note in Reading Mode, proper outline without missing headings after blockmath, working links to headings after blockmath

Actual result

In reading mode note appears as if math broke something (though the syntax is correct). All the headings after broken blockmath disappeared (don’t see them in “outline” core plugin). Links to these headings (whish disappeared in outline) doesn’t work; they behave as if there were no such headings at all.

Environment

SYSTEM INFO:
Obsidian version: v1.8.10
Installer version: v1.7.7
Operating system: Windows 11 Home 10.0.26100
Login status: not logged in
Language: en
Insider build toggle: off
Live preview: on
Base theme: adapt to system
Community theme: none
Snippets enabled: 0
Restricted mode: on

RECOMMENDATIONS:
none


Additional information

I attached the sandbox vault where this bug is reproduced in two files: «Huge note with another kind of broken math» and «Note with broken math».

  1. The second file shows how particular placement of dollars and text produce expected erroneous result. See the file itself for details.
  2. The first file (huge one) is my algebra notes in which the same erroneous result is produced by a bit different (but similar) circumstances. You are to ignore 99% of this note and see only the very end, where I reproduced the bug. Other details and description of “different circumstances” you will find in the very end of this huge note (under # Broken part heading).

There is also a file “This is how broken documents look like in reading mode” which name suggests its content.

And the last file is “Note with working math”. It is the same as “Note with broken math” except for an absence of text right after second $$.

The general rule of thumb in Markdown is if something isn’t working, add a new line or blank line between elements.

Both

[[#header|This link doesn't work for some reason]]

$$ x+1 
$$ 
Text after second \$$ (**important**: on the same line) that causes the bug to appear.

# header

Lorem Ipsum

and

[[#header|This link doesn't work for some reason]]

$$ x+1 
$$ 

Text after second \$$ (**important**: on the same line) that causes the bug to appear.

# header

Lorem Ipsum

work. You’ll notice the “header” show up in the Outline tab, and the link to the heading works when clicked.

CleanShot 2025-06-05 at 05.19.14


As far as I know, $$ on separate lines is considered a block-level element and shouldn’t have any other text (outside the equation) on the same line as the $$.

Inline math ($...$) is fine to have text surrounding it.