summaryrefslogtreecommitdiff
path: root/crates/typst-syntax
diff options
context:
space:
mode:
authorIan Wrzesinski <133046678+wrzian@users.noreply.github.com>2025-01-23 07:27:38 -0500
committerGitHub <noreply@github.com>2025-01-23 12:27:38 +0000
commitf7bd03dd76533cda2d2626d6470d3bb55e03b012 (patch)
tree9b6ed1b911ea6a5916a4b7b7d42248593afd7f5e /crates/typst-syntax
parentb3fb6c2326ac6d585cc17d1f643bc06e076be042 (diff)
Fix delimiter unparen syntax (#5739)
Diffstat (limited to 'crates/typst-syntax')
-rw-r--r--crates/typst-syntax/src/parser.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/crates/typst-syntax/src/parser.rs b/crates/typst-syntax/src/parser.rs
index a65e5ff6..f9fb8b61 100644
--- a/crates/typst-syntax/src/parser.rs
+++ b/crates/typst-syntax/src/parser.rs
@@ -442,10 +442,10 @@ fn math_unparen(p: &mut Parser, m: Marker) {
if first.text() == "(" && last.text() == ")" {
first.convert_to_kind(SyntaxKind::LeftParen);
last.convert_to_kind(SyntaxKind::RightParen);
+ // Only convert if we did have regular parens.
+ node.convert_to_kind(SyntaxKind::Math);
}
}
-
- node.convert_to_kind(SyntaxKind::Math);
}
/// The unicode math class of a string. Only returns `Some` if `text` has