Editor: a footnote reference right before HTML breaks HTML in every note until Obsidian restarts

Steps to reproduce

  1. Create a note A.md:

    [^<b>] note
    
  2. Create a note B.md:

    Plain text and <b>bold</b> here.
    
    <div>block</div>
    
  3. Restart Obsidian. Before opening any other note that holds HTML, open A in Source mode.

  4. Open B in Live Preview, in the same tab or another one.

Did you follow the troubleshooting guide?

Yes: a sandbox vault with no community plugins, default theme and settings.

Expected result

B renders as it does when it is opened first: bold as bold text, and the <div> as a rendered HTML block.

Actual result

In B, <b>bold</b> stays as source, the text after it (> here. and the blank line) is drawn as a broken HTML block, and div>block</div> is shown as source. Source mode shows the cause: Plain wears cm-hmd-html-begin, while the < that really opens HTML wears cm-hmd-html-end.

Every note opened afterwards is affected, until Obsidian restarts. If any other note with HTML is opened first after the restart, A does no harm.

It looks as if the editor’s markdown mode learns which of its states means “inside HTML” from the first HTML it ever reads, and the [^ at the start of the line makes it learn the wrong state for the rest of the session.

Environment

SYSTEM INFO:
	Obsidian version: 1.15.0
	Installer version: 1.14.4
	Operating system: Windows 11 Pro 10.0.26300
	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

Sandbox vault, no community plugins, default theme and settings.

Additional information

Reloading the app without saving clears it as a restart does, and reproduces it the same way when A is the first note opened after the reload.

Related, but not the same: https://forum.obsidian.md/t/63314 (HTML at the start of a footnote).

B in Live Preview after opening A first:

B in Live Preview when it is opened first: