### Steps to reproduce

Take a math formula: $x+y = 5$. ← This should render properly.

However, adding a space in the beginning or end will cause Obsidian to not consider this a formula anymore: $ x+y = 5 $ ← This will not be parsed as a formula.

I would understand why would the previous expression not be parsed as a formula in its final state, but, during typing $x+y = 5$ the interpreter constantly (for every space) switches from considering it a formula to not considering it a formula for each arising space. This messes up any additional command that would be using if we are inside a formula, and is visually unappealing.

### Did you follow the troubleshooting guide? [Y/N]

Yes

### Expected result

Previously both expressions would render as math formulas. Now it’s not the case.

### Environment

SYSTEM INFO:

Obsidian version: v1.3.7

Installer version: v1.3.5

Operating system: Windows 10 Home 10.0.19045

Login status: logged in

Catalyst license: none

Insider build toggle: off

Live preview: on

Legacy editor: off

Base theme: dark

Community theme: none

Snippets enabled: 0

Restricted mode: on

Thank you