Headings following a mathblock are not present in outline if the mathblock is not placed in a newline

When the mathblock (i.e., $$$$) is placed right after or before text without a newline, the headings following the mathblock disappear from the outline.

Steps to reproduce

Consider the following markdown:

The following mathblock makes headings disappear from the outline
$$ when some text is put right after the math block **WITHOUT newline**. 

When the mathblock directly follows some text **WITHOUT newline**, the same issue occurs: $$

# This Heading Disappears From the Outline!

Copy the above markdown to a new page, and you will see the problem in the outline.

Expected result

The heading should appear in the outline no matter how the mathblock is placed.

Actual result

Nothing appears in the outline.


Obsidian version: v1.1.16
Installer version: v1.0.0
Operating system: Windows 10 Pro 10.0.19044
Login status: not logged in
Insider build toggle: off
Live preview: on
Legacy editor: off
Base theme: light
Community theme: none
Snippets enabled: 0
Restricted mode: on


Additional information

This seems to be a bug of Obsidian itself. I have Advanced Tables, Excalidraw, and Number Headings installed, but the issue persists even with all the third-party plug-ins disabled and the restricted mode turned on.

Markdown expects new lines around any blocks like


i.e., this is not “proper” markdown:

any text $$

and indeed, if you remove the interfering “any text”, the issue resolves.