Bug Report: Outline view breaks when a math block starts on the same line as preceding text
Steps to reproduce
-
Create a new note in Obsidian.
-
Paste the following Markdown content into the note. The issue is triggered by the structure under heading
# d:# a $$ a $$ # b $$ b $$ # c f $$ f $$ # d some text$$ content $$ # e This heading is not detected. -
Open the “Outline” view to observe the headings.
Did you follow the troubleshooting guide? [Y/N]
Y
(This bug is reproducible in the sandbox vault with no third-party plugins or custom CSS enabled.)
Expected result
The outline pane should display all five headings: a, b, c, d, and e.
Actual result
The outline stops parsing after heading d. Heading e and any subsequent headings do not appear in the outline view.
Environment
Additional information
The issue is triggered by any math block that starts on the same line as preceding text and whose closing $$ is at the beginning of a new line. The content inside the math block does not matter (it can be empty or have content).
The specific pattern that causes the bug is:
[some text]$$
...
$$
A simple workaround is to add a newline between the text and the opening $$. When this is done, the outline immediately parses all headings correctly.