Typst grammar bug leaves string scope unclosed, breaking highlighting in code blocks and `.typ` files
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 48/100
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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
- Ngôn ngữ chính
- TypeScript
- Star
- 652
- Fork
- 64
- Merge trung bình
- 8 giờ 45 phút
- Pull request đã merge (30 ngày)
- 36
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của quarto-dev/quarto
-
VS Code extension: `quarto preview` fails when the file path contains parentheses (path not shell-quoted)Có thể đã có người làm @Bondrewd-K đã nhận 4 ngày trước. Đang mởbug vscode
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
quarto-dev/quarto#1194 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
quarto-dev/quarto#1139 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 90/100
quarto-dev/quarto#1138 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
quarto-dev/quarto#1137 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Add dependabot?Có thể làm lại được Pull request cho issue này đã bị đóng mà không được merge. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
quarto-dev/quarto#1135 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của quarto-dev/quarto
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Pet submission: Sleepwing / 眠翼鸟Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
OpenPetsHQ/openpets#273 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
fritzprix/libr-agent#2161 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
macOS: clicking a menu item that has a submenu closes the menu instead of opening the submenuĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 83/100
blackboardsh/electrobun#581 ·
-
backlog-skill effort:xs frontend infra ready-for-agent
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
LucasSantana-Dev/Lucky#2862 ·
Maintainer thường phản hồi trong vòng 1 ngày