quarto-dev / quarto-dev/quarto-cli
`.md` file with key-attribute first in fenced code block is wrongly detected as executable code cell
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 6k
- Forks
- 458
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 41
Description
Bug description
When rendering a .md file, Quarto incorrectly detects a fenced code block as an executable code cell if the first attribute is a key-value pair rather than a class.
For example, ```{filename="demo.sh" .bash} triggers the error, while ```{.bash filename="demo.sh"} renders correctly.
The attribute order should not matter. Both forms are valid Pandoc fenced code block attributes and neither represents an executable code cell.
Steps to reproduce
Save the following as demo.md:
---
title: demo
---
```{filename="demo.sh" .bash}
echo "Hello"
```
Then run:
quarto render demo.md
Actual behavior
ERROR: You must use the .qmd extension for documents with executable code.
Expected behavior
The document should render successfully, just as it does when the class appears before the key-value attribute:
```{.bash filename="demo.sh"}
echo "Hello"
```
Your environment
- OS: macOS (Darwin 25.3.0)
Quarto check output
Quarto 99.9.9
[✓] Checking environment information...
Quarto cache location: /Users/mcanouil/Library/Caches/quarto
[✓] Checking versions of quarto binary dependencies...
Pandoc version 3.8.3: OK
Dart Sass version 1.87.0: OK
Deno version 2.4.5: OK
Typst version 0.14.2: OK
[✓] Checking versions of quarto dependencies......OK
[✓] Checking Quarto installation......OK
Version: 99.9.9
commit: cb7f370bed23fca88ab932b0f72bb59173f88b7e
Path: /Users/mcanouil/Projects/quarto-dev/quarto-cli/package/dist/bin
[✓] Checking tools....................OK
TinyTeX: v2026.02
Chromium: (not installed)
Chrome Headless Shell: (not installed)
VeraPDF: (not installed)
[✓] Checking LaTeX....................OK
Using: TinyTex
Path: /Users/mcanouil/Library/TinyTeX/bin/universal-darwin
Version: 2025
[✓] Checking Chrome Headless....................OK
Using: Chrome from QUARTO_CHROMIUM
Path: /Applications/Brave Browser.app/Contents/MacOS/Brave Browser
[✓] Checking basic markdown render....OK
[✓] Checking R installation...........OK
Version: 4.5.2
Path: /Library/Frameworks/R.framework/Resources
LibPaths:
- /Users/mcanouil/Projects/quarto-dev/quarto-playground/renv/library/macos/R-4.5/aarch64-apple-darwin20
- /Users/mcanouil/Library/Caches/org.R-project.R/R/renv/sandbox/macos/R-4.5/aarch64-apple-darwin20/4cd76b74
knitr: 1.50
rmarkdown: 2.30
[✓] Checking Knitr engine render......OK
[✓] Checking Python 3 installation....OK
Version: 3.14.0
Path: /Users/mcanouil/Projects/quarto-dev/quarto-playground/.venv/bin/python3
Jupyter: 5.9.1
Kernels: uv, julia-1.12, python3
[✓] Checking Jupyter engine render....OK
[✓] Checking Julia installation...
Version: 1.12.0
Path: /Users/mcanouil/.juliaup/bin
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.
Research direction
Reproduce the issue with the supplied demo.md example and run quarto render demo.md, then compare it with the working attribute order. Trace the fenced-code attribute detection used by the Quarto CLI and add coverage showing that key-value-first and class-first forms both render successfully without executable-cell handling.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 48/100