diff --git a/services/web/frontend/js/features/source-editor/lezer-typst/typst.grammar b/services/web/frontend/js/features/source-editor/lezer-typst/typst.grammar index 68c9db2ec6..142c822282 100644 --- a/services/web/frontend/js/features/source-editor/lezer-typst/typst.grammar +++ b/services/web/frontend/js/features/source-editor/lezer-typst/typst.grammar @@ -38,7 +38,7 @@ Heading { HeadingMark HeadingTitle? } // External tokens are context-isolated by the LR state machine — no merging. // ── Comments ────────────────────────────────────────────────────────────── -LineComment { "//" LineCommentContent } +LineComment { "//" LineCommentContent? } // BlockCommentBody is external so it can track nesting depth — // Typst supports /* /* nested */ */ block comments. BlockComment { "/*" BlockCommentBody? "*/" } @@ -182,7 +182,7 @@ Escape { "\\" EscapeChar } } // Comment content — everything to end of line. - LineCommentContent { ![\n]* } + LineCommentContent { ![\n]+ } // Math content — everything between the $ delimiters (no crossing newlines). MathContent { ![$\n]+ }