quarto-dev / quarto-dev/quarto-cli

SQL chucks appear different with R chunks when eval is false

Open
#2,137 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
JavaScript
Stars
6k
Forks
458
Avg merge
1d 9h
Merged PRs (30d)
41

Description

Bug description

I'm redoing my website using a Quarto blog. When I have post set to eval: false with a SQL code chunk and an R code chunk, it looks fine. When I remove the R part, it changes formatting.

To reproduce, I have a blog post with each of these options:

  1. Blog post without R chunk.
---
title: "Test without R"
date: "2022-08-24"
execute: 
  eval: false
---

```{sql test}
SELECT * FROM EXAMPLE;
```

![Test without R code](https://user-images.githubusercontent.com/15098268/186791358-28b8b09a-77f0-4d36-948d-79c68c563e9c.png)


2) Same blog post, but with a blank R chunk at the end.
---
title: "Test with R"
date: "2022-08-25"
execute: 
  eval: false
---

```{sql test}
SELECT * FROM EXAMPLE;
```

```{r}
```

Test with R code


The SQL section outputs are different.

Screenshot of the first blog post. Formatting does not have syntax highlighting.
Test without R

Screenshot of the second blog post. This does have highlighting.
Test with R

Screenshot of the home page.
Home page

I don't know why they don't match. I just updated to the newest Quarto version (but I think it was happening on the previous one too). This is on RStudio 2022.07.1 Build 554. "Spotted Wakerobin" for macOS, on Monterey.

Checklist
  • 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.
  • Please format your issue so it is easier for us to read the bug report.
  • Please document the RStudio IDE version you're running (if applicable), by providing the value displayed in the "About RStudio" main menu dialog?
  • Please document the operating system you're running. If on Linux, please provide the specific distribution.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the report from a single .qmd file using the shown SQL chunk, optional blank R chunk, and execute: eval: false setting. Compare the rendered SQL formatting and syntax highlighting with and without the R chunk; done means both cases produce matching SQL output.

Written by the indexing model from the issue text.

Assessment

Tech stack
r, sql
Domain
documentation
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.