Built-in highlighting for ```qmd (and ```markdown / ```md) code blocks with q2's own qmd parser
Los mantenedores suelen responder en 1 día
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 35/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- rust
- Área
- backend, developer-experience
Línea de trabajo
Start by tracing q2's code block highlighting and built-in grammar registration, then inspect the bundled tree-sitter-qmd parser and its highlights.scm query. Check how aliases and grammar injections are handled for embedded code cells and YAML front matter. Done means qmd, markdown, and md blocks receive the requested syntax highlighting, including the listed Quarto constructs.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
q2 has no built-in highlighting for Quarto markdown in code blocks: ```qmd, ```markdown, and ```md render as plain <pre> with no sourceCode wrapper. Documentation about Quarto and about publishing tools shows a lot of qmd and markdown. q2 already has its own qmd parser, tree-sitter-qmd, so it is the natural grammar for these blocks.
Versions
- q2 0.41.0 (macOS, arm64)
- Quarto 1.11.7, for comparison
Repro
index.qmd, with no _quarto.yml:
---
title: qmd highlighting
engine: markdown
---
`````qmd
---
title: "Report"
format: html
---
## Results
Some **bold** text and a [link](https://example.com).
```{python}
#| echo: false
print("hello")
```
`````
````markdown
## Results
Some **bold** text.
````
q2 render index.qmd
Quarto 1.11.7
```qmd: not highlighted (<pre class="qmd">). Pandoc's highlighter does not knowqmd.```markdown: highlighted with Pandoc's Markdown syntax (<pre class="sourceCode markdown">, heading tokens).
q2 0.41.0
Both blocks are <pre class="qmd code-with-copy"> and <pre class="markdown code-with-copy">, with no spans and no div.sourceCode wrapper.
Request
Highlight qmd, with markdown and md as aliases, using q2's own parser: front matter, headings, emphasis, links, code cells and their #| options, shortcodes, and divs. Ideally, embedded code cells and YAML front matter are highlighted with the matching built-in grammars, like an injection.
Notes
I tried the user-grammar route first. tree-sitter build --wasm on crates/tree-sitter-qmd/tree-sitter-markdown gives a 1.1 MB WASM file. It loads from _quarto/grammars/ only under the name markdown, because the WASM exports tree_sitter_markdown and the user-grammar loader derives the language function from the file name, so it cannot register qmd. With the bundled queries/highlights.scm, only **strong** and some punctuation get spans. Headings, links, front matter, and the nested code cell stay plain. A built-in, native path seems better than asking projects to vendor a large WASM build of q2's own parser.
- Lenguaje dominante
- Rust
- Estrellas
- 293
- Forks
- 20
- Merge medio
- 7 h 45 min
- PR fusionados (30 d)
- 187
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de quarto-dev/q2
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
quarto-dev/q2#1031 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
quarto-dev/q2#957 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 3/5 1-2 días Aptitud para principiantes 72/100
quarto-dev/q2#1079 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 3/5 1-2 días Aptitud para principiantes 72/100
quarto-dev/q2#1053 ·
Los mantenedores suelen responder en 1 día
-
hub-client: "Expand markup" and "Expand preview" should hide the other pane instead of shrinking itAbierto
Dificultad 3/5 1-2 días Aptitud para principiantes 72/100
quarto-dev/q2#1037 ·
Los mantenedores suelen responder en 1 día
Todos los issues de quarto-dev/q2
Issues similares
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
-
bug order-flow studies ui
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
userFRM/egui-charts#2417 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 2 días
-
In a plain-text message, Font, Font Size, Font Color and Text Highlight Color stay livePosiblemente ocupada @ragelfundionctrumnar la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
UCS-Care-Group/mailcraft#862 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
smoltcp-rs/smoltcp#1243 ·
Los mantenedores suelen responder en 1 día