quarto-dev / quarto-dev/quarto
Toggling between source and visual editor alters spacing of fenced divs
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 645
- Forks
- 62
- Avg merge
- 17h 42m
- Merged PRs (30d)
- 13
Description
Bug description
I have a large file with various panel sets in it. I understand the visual mode is not functioning the best. I prefer to work in source mode anyway, but I enjoy the spell checking that visual mode has. When switching between the two, there are a lot of alterations to my document that show up in the code diff that seem unnecessary related to the ::: fenced div options. I haven't noticed any issues with actual rendering, but the problems tab in Positron becomes annoying with many error messages.
Steps to reproduce
- Create a new directory in Positron.
- Optionally create a new Quarto project
quarto create project default . new_directory. Can probably just create a new Quarto document instead. - To your new document, insert the following R code chunk while in Source mode:
::::: {.panel-tabset}
# Tab 1
```{r}
library(tidyverse)
```
# Tab 2
```{r}
library(tidymodels)
```
:::::
::: {.callout-important}
This should not be altered!
:::
- Save and toggle to Visual mode. Notice that while nothing has changed, Positron asks you to save the file again.
- Toggle back to Source mode and notice the changes to the
:::fenced div options.
Somewhere along the lines, the white space between the ::: fenced div and the next nearest item is removed. On the top, the space between the text and ::: is removed, the space between the end of the code chunk ``` and ::: is removed, and the space around the text in the callout note is removed. I have tried a callout note with two white spaces above and below the text, and it is all collapsed between toggling. Note: In saving with Air, I don't observe any modifications to these white space options.
Actual behavior
I don't observe any issues with the document rendering. That all happens as normal. The GitHub diff is annoying across a document, with many of these options. I guess I also prefer to have spaces around these and code chunks so that they are easier to modify and see in a document. There is a problems call in the second screenshot related to a syntax error, but again, the document renders without error regardless.
Start in Source
Next, Toggle to Visual
Return to Source
Expected behavior
I would expect the white spacing around these ::: fenced divs to remain unchanged when toggling between Source and Visual modes.
Your environment
Positron Version: 2025.07.0 build 204
Code - OSS Version: 1.100.3
Commit: 03ae7a5393c776bb24c23d2aa6a6bfbba90cbc5e
Date: 2025-06-30T16:29:03.492Z
Electron: 34.5.1
Chromium: 132.0.6834.210
Node.js: 20.19.0
V8: 13.2.152.41-electron.0
OS: Darwin arm64 24.5.0
quarto check
Quarto 1.7.31
[✓] Checking environment information...
Quarto cache location: /Users/logan.johnson/Library/Caches/quarto
[✓] Checking versions of quarto binary dependencies...
Pandoc version 3.6.3: OK
Dart Sass version 1.85.1: OK
Deno version 1.46.3: OK
Typst version 0.13.0: OK
[✓] Checking versions of quarto dependencies......OK
[✓] Checking Quarto installation......OK
Version: 1.7.31
Path: /Applications/quarto/bin
[✓] Checking tools....................OK
TinyTeX: v2025.05
Chromium: (not installed)
[✓] Checking LaTeX....................OK
Using: TinyTex
Path: /Users/logan.johnson/Library/TinyTeX/bin/universal-darwin
Version: 2025
[✓] Checking Chrome Headless....................OK
Using: Chrome found on system
Path: /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
Source: MacOS known location
[✓] Checking basic markdown render....OK
[✓] Checking Python 3 installation....OK
Version: 3.9.18 (Conda)
Path: /Users/logan.johnson/opt/anaconda3/bin/python
Jupyter: 5.5.0
Kernels: python3
[✓] Checking Jupyter engine render....OK
[✓] Checking R installation...........OK
Version: 4.4.2
Path: /Library/Frameworks/R.framework/Resources
LibPaths:
- /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library
knitr: 1.47
rmarkdown: 2.27
[✓] Checking Knitr engine render......OK
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the provided fenced-div example in a Quarto document and toggling between Source and Visual modes in Positron. Trace the source-to-visual conversion involved in that toggle, since no implementation file or test is named. Done means the spacing around fenced divs and code chunks remains unchanged and the unwanted diagnostics no longer appear.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- markdown
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100