Typst grammar bug leaves string scope unclosed, breaking highlighting in code blocks and `.typ` files
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
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
- 平均合并
- 22 小时 16 分钟
- 30 天内合并 PR
- 42
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
quarto-dev/quarto 的其他 Issue
-
难度 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?可能重新可做 关联的 PR 已关闭且未合并。 未关闭
难度 2/5 1-3 小时 新手友好度 68/100
quarto-dev/quarto#1135 ·
维护者通常 1 天内回复
-
AceNodeView: programmatic setSelection() marks the cursor dirty, scrolling the document to the front matter可能已有人在做 @kevinushey 于 55 天前认领。 未关闭
难度 1/5 1 小时以内 新手友好度 90/100
quarto-dev/quarto#1099 ·
维护者通常 1 天内回复
查看 quarto-dev/quarto 的全部 Issue
相似的 Issue
-
area: repo priority: P2 type: bug
难度 2/5 1-3 小时 新手友好度 76/100
appandflow/stim#4107 · 1 条评论 ·
维护者通常 1 天内回复
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
难度 1/5 1-3 小时 新手友好度 60/100
lingdojo/kana-dojo#32859 · 1 条评论 · 5 个 reaction ·
维护者通常 1 天内回复
-
code-quality refactoring
难度 2/5 1-3 小时 新手友好度 78/100
github/gh-aw-firewall#10364 ·
维护者通常 1 天内回复
-
Merge the duplicate kaffir_corn record into sorghum可能已有人在做 @Crypto-Shroom 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 65/100
Crypto-Shroom/Bird-Feed-Calculator#322 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 75/100
drizzle-team/drizzle-orm#6552 ·
维护者通常 2 天内回复