Skip to content

Use correct pandoc markdown (blank lines around fenced code block) for code annotation #12255

@juliasilge

Description

@juliasilge

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 posit-dev/air#280

It might be good to explicitly document this on the page at https://quarto.org/docs/authoring/markdown-basics.html#source-code

Metadata

Metadata

Assignees

Labels

documentationDoc improvements & quarto-weblintlinting-related issues

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions