mirror of
https://github.com/typst/typst
synced 2025-05-13 20:46:23 +08:00
Make math shorthands noncontinuable (#5925)
This commit is contained in:
parent
240f238eee
commit
55bc5f4c94
@ -271,10 +271,11 @@ fn math_expr_prec(p: &mut Parser, min_prec: usize, stop: SyntaxKind) {
|
||||
}
|
||||
|
||||
SyntaxKind::Text | SyntaxKind::MathText | SyntaxKind::MathShorthand => {
|
||||
continuable = matches!(
|
||||
math_class(p.current_text()),
|
||||
None | Some(MathClass::Alphabetic)
|
||||
);
|
||||
continuable = !p.at(SyntaxKind::MathShorthand)
|
||||
&& matches!(
|
||||
math_class(p.current_text()),
|
||||
None | Some(MathClass::Alphabetic)
|
||||
);
|
||||
if !maybe_delimited(p) {
|
||||
p.eat();
|
||||
}
|
||||
|
BIN
tests/ref/math-shorthands-noncontinuable.png
Normal file
BIN
tests/ref/math-shorthands-noncontinuable.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 475 B |
@ -13,6 +13,11 @@ $ underline(f' : NN -> RR) \
|
||||
1 - 0 thick &...,
|
||||
) $
|
||||
|
||||
--- math-shorthands-noncontinuable ---
|
||||
// Test that shorthands are not continuable.
|
||||
$ x >=(y) / z \
|
||||
x >= (y) / z $
|
||||
|
||||
--- math-common-symbols ---
|
||||
// Test common symbols.
|
||||
$ dot \ dots \ ast \ tilde \ star $
|
||||
|
Loading…
x
Reference in New Issue
Block a user