Typst grammar bug leaves string scope unclosed, breaking highlighting in code blocks and `.typ` files
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 48/100
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
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
- 主要言語
- TypeScript
- スター
- 655
- フォーク
- 64
- 平均マージ
- 8時間 45分
- マージ済み PR(30日)
- 36
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
quarto-dev/quarto のほかの issue
-
VS Code extension: `quarto preview` fails when the file path contains parentheses (path not shell-quoted)対応中かも @Bondrewd-K が 5 日前に担当しました。 オープンbug vscode
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
quarto-dev/quarto#1194 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
quarto-dev/quarto#1139 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1〜3時間 初心者へのやさしさ 90/100
quarto-dev/quarto#1138 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
quarto-dev/quarto#1137 ·
メンテナーはふだん 1 日以内に返信
-
Add dependabot?再び着手できるかも このイシューのプルリクエストはマージされずにクローズされました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
quarto-dev/quarto#1135 ·
メンテナーはふだん 1 日以内に返信
quarto-dev/quarto の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
simkimsia/netlify-axi#19 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
subhranshudash13-dotcom/Contribo#74 ·
メンテナーはふだん 1 日以内に返信
-
enhancement frontend good first issue Stellar Wave trivial
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
Godgift-care/sci-healthcare-frontend#166 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
backend good first issue security Stellar Wave trivial
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
Godgift-care/sci-healthcare-backend#171 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信