### Bug description

Hello,

I mostly edit in VScode but occasionally switch to RStudio to use the visual editor for idiosyncratic reasons. I've noticed when subsequently switching back to VScode that my line numbering has been changed around inline math. For example, if I originally had

```
The equation is 
$$
Y = ax + b.
$$

That is a line.

``` 

This is then converted to something like 

```
The equation is $$
Y = ax + b.
$$ That is a line.

``` 
which creates problems down the line for code coloring and folding. 

Running RStudio 2022.07.0 Build 548 on macOS Ventura (but also experienced this issue before upgrading to Ventura). 

### Checklist

- [X] Please include a minimal, fully reproducible example in a single .qmd file? Please provide the whole file rather than the snippet you believe is causing the issue.
- [X] Please [format your issue](https://quarto.org/bug-reports.html#formatting-make-githubs-markdown-work-for-us) so it is easier for us to read the bug report.
- [X] Please document the RStudio IDE version you're running (if applicable), by providing the value displayed in the "About RStudio" main menu dialog?
- [X] Please document the operating system you're running. If on Linux, please provide the specific distribution.
2022-10-27T15:22:10Z
halidaee
bug
closed
Opening .qmd in RStudio visual editor changes line numbering (especially for display style equations)
https://github.com/quarto-dev/quarto-cli/issues/3069