mirror of https://github.com/stelzo/typst.git
Fix delimiter unparen syntax (#5739)
This commit is contained in:
parent
b3fb6c2326
commit
f7bd03dd76
|
|
@ -442,11 +442,11 @@ fn math_unparen(p: &mut Parser, m: Marker) {
|
||||||
if first.text() == "(" && last.text() == ")" {
|
if first.text() == "(" && last.text() == ")" {
|
||||||
first.convert_to_kind(SyntaxKind::LeftParen);
|
first.convert_to_kind(SyntaxKind::LeftParen);
|
||||||
last.convert_to_kind(SyntaxKind::RightParen);
|
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
|
/// 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
|
/// exactly one unicode character or is a math shorthand string (currently just
|
||||||
|
|
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 493 B |
|
|
@ -125,3 +125,11 @@ $ lr(size: #3em, |)_a^b lr(size: #3em, zws|)_a^b
|
||||||
--- issue-4188-lr-corner-brackets ---
|
--- issue-4188-lr-corner-brackets ---
|
||||||
// Test positioning of U+231C to U+231F
|
// Test positioning of U+231C to U+231F
|
||||||
$⌜a⌟⌞b⌝$ = $⌜$$a$$⌟$$⌞$$b$$⌝$
|
$⌜a⌟⌞b⌝$ = $⌜$$a$$⌟$$⌞$$b$$⌝$
|
||||||
|
|
||||||
|
--- math-lr-unparen ---
|
||||||
|
// Test that unparen with brackets stays as an LrElem.
|
||||||
|
#let item = $limits(sum)_i$
|
||||||
|
$
|
||||||
|
1 / ([item]) quad
|
||||||
|
1 / [item]
|
||||||
|
$
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue