Typst grammar bug leaves string scope unclosed, breaking highlighting in code blocks and `.typ` files
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 48/100
Línea de trabajo
Start with Quarto's Typst TextMate grammar and reproduce the leak in the supplied test.qmd example and a standalone test.typ file with the Quarto extension enabled. Determine how strings containing # inside #context are scoped and how the grammar is injected into source.typst. Done means the closing quote ends the string scope and standalone Typst highlighting no longer conflicts with native tooling.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Bug description
Quarto's Typst TextMate grammar has a parsing bug: it fails to recognize the closing quote of a string if it contains a # inside a #context block.
Impact on standalone .typ files:
Because Quarto injects this grammar globally into source.typst, this exact same bug completely breaks the syntax highlighting for standalone .typ files as well, overriding dedicated extensions like Tinymist.
Steps to reproduce
- Create a
test.qmdfile. - Paste the following code:
```typst
#context {
let c = rgb("#8C6A48")
}
= Heading
Text
```
(Note: The exact same issue can be reproduced in a standalone test.typ file with the Quarto extension enabled.)
Actual behavior
Everything after "#8C6A48" (including = Heading and Text) is incorrectly highlighted as a string because the scope never closes.
Inside a .qmd file, the markdown code fence barely contains the leak. However, in a standalone .typ file (which has no markdown fences), this single bug breaks the syntax highlighting for the entire rest of the file down to EOF.
Expected behavior
- The Typst grammar should correctly recognize the closing quote of strings containing
#and close the string scope. - Quarto's Typst grammar injection should ideally be restricted to
.qmd/.mdfiles, or there should be an opt-out setting for standalone.typfiles to prevent global conflicts with native Typst tooling.
Your environment
- IDE: VSCode v1.130.0
- Quarto Extension: v1.135.0
- Tinymist Extension: v0.15.2
- OS: Windows 11
- Lenguaje dominante
- TypeScript
- Estrellas
- 652
- Forks
- 64
- Merge medio
- 8 h 45 min
- PR fusionados (30 d)
- 36
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
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/quarto
-
VS Code extension: `quarto preview` fails when the file path contains parentheses (path not shell-quoted)Posiblemente ocupada @Bondrewd-K la tomó hace 3 días. Abiertobug vscode
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
quarto-dev/quarto#1194 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
quarto-dev/quarto#1139 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 1-3 horas Aptitud para principiantes 90/100
quarto-dev/quarto#1138 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
quarto-dev/quarto#1137 ·
Los mantenedores suelen responder en 1 día
-
Add dependabot?Quizá libre de nuevo Un pull request para esta issue se cerró sin fusionarse. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
quarto-dev/quarto#1135 ·
Los mantenedores suelen responder en 1 día
Todos los issues de quarto-dev/quarto
Issues similares
-
backend priority:P3 privacy-fix
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
[Bug]: 【优化】对话消息底部增加发送时间展示Abiertobug desktop v3 windows
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
esengine/DeepSeek-Reasonix#13697 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
area:security documentation effort:S priority:P2
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
Los mantenedores suelen responder en 1 día
-
app:web meta:ops
Dificultad 2/5 Medio día Aptitud para principiantes 78/100
osu-tournament-rating/otr#1113 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100