### Steps to reproduce

for example, the following latex formula:

```
$\overrightarrow{a}=\left( x_{1},y_{1}\right) ;\overrightarrow{b}=\left( x_{2},y_{2}\right) $
```

There is an extra space before the end ‘$’.

- if the extra space exist, the formula display is not correct
- if the extra space is deleted, the formula display correct

### Expected result

if the extra space is deleted:

### Actual result

### Environment

- win10
- obsidian 1.1.16