quarto-dev / quarto-dev/quarto-cli
Use correct pandoc markdown (blank lines around fenced code block) for code annotation
@cscheid is already working on this.
Since Mar 10, 2025.
- Dominant language
- JavaScript
- Stars
- 6k
- Forks
- 458
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 41
Description
What would you like to do?
Report an issue on quarto.org
Description
The code at https://quarto.org/docs/authoring/code-annotation.html#annotation-syntax needs a blank line between the fenced code block and the annotations, so it looks like this:
```r
library(tidyverse)
library(palmerpenguins)
penguins |> # <1>
mutate( # <2>
bill_ratio = bill_depth_mm / bill_length_mm, # <2>
bill_area = bill_depth_mm * bill_length_mm # <2>
) # <2>
```
1. Take `penguins`, and then,
2. add new columns for the bill ratio and bill area.
We are noticing that folks may not be aware of the fact that pandoc markdown requires these kinds of empty lines, as specified here:
https://pandoc.org/MANUAL.html#fenced-code-blocks
Note:
Like regular code blocks, fenced code blocks must be separated from surrounding text by blank lines.
This becomes more urgent as people use tools (like air) that use the virtual documents generated from the VS Code extension; see https://github.com/posit-dev/air/issues/280
It might be good to explicitly document this on the page at https://quarto.org/docs/authoring/markdown-basics.html#source-code
Contributor guide
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.
Assessment
This issue has not been assessed yet.