### Bug description

In my documents, I prefer to write each new sentence in a new line so changes are easier to track on GitHub. However, Quarto deletes line breaks and merges separate sentences into a single line if I switch between source and visual view.

It is hard to generate a reproducible example because the issue only arises when switching between views, so here is a `.gif` of what it looks like.

![quarto_linebreaks](https://user-images.githubusercontent.com/45146055/179239286-e1ebd591-642b-43ea-a257-1fbc0f5e1046.gif)

Here is the corresponding code (before the linebreaks get deleted):

```R
---
title: "Linebreak Test"
format: html
editor: visual
---

## Heading

This is my first sentence. 
This is my second sentence. 
Here is another sentence.
```

The problem occurs in R versions 4.2.0 and 4.2.1, RStudio version 2022.2.3.492 and 2022.7.0.548 on Windows 11 (Version 21H2 (OS Build 22000.795). 

Result of `xfun::session_info('rmarkdown')`:

```
R version 4.2.1 (2022-06-23 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 22000), RStudio 2022.7.0.548

Locale:
  LC_COLLATE=English_Germany.utf8 
  LC_CTYPE=English_Germany.utf8   
  LC_MONETARY=English_Germany.utf8
  LC_NUMERIC=C                    
  LC_TIME=English_Germany.utf8    

Package version:
  base64enc_0.1.3 bslib_0.3.1     digest_0.6.29   evaluate_0.15  
  fastmap_1.1.0   fs_1.5.2        glue_1.6.2      graphics_4.2.1 
  grDevices_4.2.1 highr_0.9       htmltools_0.5.2 jquerylib_0.1.4
  jsonlite_1.8.0  knitr_1.39      magrittr_2.0.3  methods_4.2.1  
  R6_2.5.1        rappdirs_0.3.3  rlang_1.0.4     rmarkdown_2.14 
  sass_0.4.1      stats_4.2.1     stringi_1.7.8   stringr_1.4.0  
  tinytex_0.40    tools_4.2.1     utils_4.2.1     xfun_0.31      
  yaml_2.3.5     

Pandoc version: 2.18
```

### `quarto check` Output

```bash
[>] Checking Quarto installation......OK
      Version: 1.0.18
      Path: C:\Program Files\Quarto\bin\
      CodePage: 1252

[>] Checking basic markdown render....OK

[>] Checking Python 3 installation....OK
      Version: 3.9.7 (Conda)
      Path: C:/ProgramData/Anaconda3/python.exe
      Jupyter: 4.8.1
      Kernels: python3

[>] Checking Jupyter engine render....OK

[>] Checking R installation...........OK
      Version: 4.2.1
      Path: C:/PROGRA~1/R/R-42~1.1
      LibPaths:
        - C:/Program Files/R/R-4.2.1/library
      rmarkdown: 2.14

[>] Checking Knitr engine render......OK
```

### `quarto tools check` Output

```bash
[>] Inspecting tools

Tool         Status            Installed     Latest
chromium     Not installed     ---           869685
tinytex      Not installed     ---           v2022.07
```

### Checklist

- [X] [formatted your issue](https://yihui.org/issue/#please-format-your-issue-correctly) so it is easier for us to read?
- [X] included 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] documented the quarto version you're running, by pasting the output from running `quarto check` in the "Quarto Check Output" text area?
- [X] documented the version of the quarto tools you're running, by providing the output from running `quarto tools check` in the "Quarto Tools Check Output" text area?
- [X] documented the RStudio IDE version you're running (if applicable), by providing the value displayed in the "About RStudio" main menu dialog?
- [X] documented which operating system you're running? If on Linux, please provide the specific distribution as well.
- [X] upgraded to the latest version, including your versions of R, the RStudio IDE, and relevant R packages?
2022-07-15T14:27:09Z
einGlasRotwein
bug
closed
Line breaks get deleted when moving between source and visual
https://github.com/quarto-dev/quarto-cli/issues/1409