quarto-dev / quarto-dev/quarto-cli

Issues with syntax highlighting for code comments in diagram chunks

Open
#1,453 1 comment 0 reactions 2 assignees View on GitHub

@cderv is already working on this.

Since Dec 9, 2024.

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

Description

Bug description

Below are three chunks: diagram with mermaid, diagram with dots, figure with R code.

```{mermaid}
%%| echo: fenced
%%| label: fig-mermaid
%%| fig-width: 2
%%| fig-cap: A caption that contains words like use, or, and.

flowchart LR
  A[A] --> B(B)
  A[A] --> C(C)
```

```{dot}
//| echo: fenced
//| label: fig-dot
//| fig-width: 2
//| fig-cap: A caption that contains words like use, or, and.

graph G {
  layout=neato
  a -- b;
  a -- c;
}
```

```{r}
#| echo: fenced
#| label: fig-r
#| fig-width: 6
#| fig-cap: A caption that contains words like use, or, and.

plot(cars)
```

The syntax highlighting in the output is inconsistent across these chunks -- comments seem to receive highlighting like code in the diagram chunks.

Screen Shot 2022-07-19 at 2 10 09 AM Screen Shot 2022-07-19 at 2 10 16 AM Screen Shot 2022-07-19 at 2 10 24 AM
quarto check Output
[✓] Checking Quarto installation......OK
      Version: 1.0.32
      Path: /Applications/quarto/bin

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

[✓] Checking Python 3 installation....OK
      Version: 3.10.1
      Path: /usr/local/bin/python3
      Jupyter: 4.9.1
      Kernels: python3

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

[✓] Checking R installation...........OK
      Version: 4.2.1
      Path: /Library/Frameworks/R.framework/Resources
      LibPaths:
        - /Users/mine/Desktop/RStudio/quarto-tip-a-day/renv/library/R-4.2/x86_64-apple-darwin17.0
        - /Library/Frameworks/R.framework/Versions/4.2/Resources/library
      rmarkdown: 2.14

[✓] Checking Knitr engine render......OK
quarto tools check Output
Tool         Status            Installed     Latest  
chromium     Not installed     ---           869685  
tinytex      Up to date        v2022.07      v2022.07
  • RStudio: RStudio 2022.07.0+548 "Spotted Wakerobin" Release (34ea3031089fa4e38738a9256d6fa6d70629c822, 2022-07-06) for macOS Mozilla/5.0 (Macintosh; Intel Mac OS X 12_4_0) AppleWebKit/537.36 (KHTML, like Gecko) QtWebEngine/5.12.10 Chrome/69.0.3497.128 Safari/537.36
  • OS: macOS 12.4
Checklist
  • formatted your issue so it is easier for us to read?
  • 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.
  • documented the quarto version you're running, by pasting the output from running quarto check in the "Quarto Check Output" text area?
  • 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?
  • documented the RStudio IDE version you're running (if applicable), by providing the value displayed in the "About RStudio" main menu dialog?
  • documented which operating system you're running? If on Linux, please provide the specific distribution as well.
  • upgraded to the latest version, including your versions of R, the RStudio IDE, and relevant R packages?

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.