Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Typst grammar bug leaves string scope unclosed, breaking highlighting in code blocks and `.typ` files

Aperta
#1,072 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
48/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
vscode
Ambito
devtools, tooling

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug
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
  1. Create a test.qmd file.
  2. 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
  1. The Typst grammar should correctly recognize the closing quote of strings containing # and close the string scope.
  2. Quarto's Typst grammar injection should ideally be restricted to .qmd/.md files, or there should be an opt-out setting for standalone .typ files 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
Lingua principale
TypeScript
Stelle
652
Fork
64
Merge medio
8h 45m
PR unite (30g)
36

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di quarto-dev/quarto

Tutte le issue di quarto-dev/quarto

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.