Inline LaTeX - escaped curly braces cause codemirror to leave math mode

Steps to reproduce

Type $\{ \}$. Latex/math mode is not maintained in the editor; it switches back to normal text. It does render correctly in preview.

Expected result

Editing should occur in math mode, with math mode CSS rules applied.

Actual result

Editor entered normal text mode

Environment

  • Operating system: macOS
  • Obsidian version: 0.6.5
  • Using custom CSS: Yes

Additional information

Additionally, here are two screenshots that describe the problem:

And here you can see the editor is not in cm-math but instead is in cm-escape:

I hope this is easy to fix…I could see this being a nasty one.

thanks for the report

Interestingly, if you type another inline block after one of these blocks, they all display correctly. For example the following will show in the editor with the correct CSS classes applied:

$\{ \}$ something something $x$

Confirming the above issue in 0.6.6

fixed in 0.7.2

1 Like