Fix delimiter unparen syntax (#5739)

This commit is contained in:
Ian Wrzesinski 2025-01-23 07:27:38 -05:00 committed by GitHub
parent b3fb6c2326
commit f7bd03dd76
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 10 additions and 2 deletions

View File

@ -442,11 +442,11 @@ 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);
}
}
}
/// The unicode math class of a string. Only returns `Some` if `text` has
/// exactly one unicode character or is a math shorthand string (currently just

Binary file not shown.

After

Width:  |  Height:  |  Size: 493 B

View File

@ -125,3 +125,11 @@ $ lr(size: #3em, |)_a^b lr(size: #3em, zws|)_a^b
--- issue-4188-lr-corner-brackets ---
// Test positioning of U+231C to U+231F
$ab$ = $$$a$$$$$$b$$$
--- math-lr-unparen ---
// Test that unparen with brackets stays as an LrElem.
#let item = $limits(sum)_i$
$
1 / ([item]) quad
1 / [item]
$