The css-class is .cm-math but it seems many other code-like elements gets the formatting too. After typing white space the element is not recognized as .cm-math. I think that is the more remarkable problem here.
So if you want workaround you should match the style of .cm-math with other text. There are three things: disable italics, monospace and code-color. You can use developer tools (View->select Toggle Developer Tools) to locate all of these. I’m not 100% familiar with it.
If you are just using MathJax to do assignments, then MarkText could be worth to try. Obviously if your use case is much broader (i.e. PKM) then I recommend following how this topic evolves. I personally think it’s a bug that could be addressed by the developers.
Remember that you can use MarkText (or any other editor) on files in the vault. Other Obsidian functions will still work.
Used to be that the Obsidian editor would reflect any changes in the other editor in more-or-less real time, but I have a vague memory of reading that is no longer the case. But it will still read the files.
I know; all the notes in Obsdian are just plain text files, after all.
But to be honest, I’m not tempted to move from one editor (insert math) to another (use Obsidian functionality) while taking notes. So it would be great if we can solve this problem nicely within Obsidian.
So you want to see the monospaced font all the time while typing. If the appearing and disappearing whitespace before the closing $ is causing the flickering (which seems like a bug given that it is so user-unfriendly), can you fool the editor by typing a random character next to the closing $ and then work on the rest of the formula, starting next to the opening $, or does that not display the appropriate formatting?
In a simple test, if I type $ 0$ and then move the cursor after the opening $ and before the (SPACE) $, I can type a simple formula without seeing any flickering, just the monospaced font and coloured text. The closing zero just needs to be deleted when the formula has been completed.
I know this is a terrible workaround but is it actually useful at all? Or for proper maths does it just look awful and meaningless when editing?