mirror of
https://github.com/typst/typst
synced 2025-05-14 17:15:28 +08:00
Make math shorthands noncontinuable (#5925)
This commit is contained in:
parent
240f238eee
commit
55bc5f4c94
@ -271,7 +271,8 @@ fn math_expr_prec(p: &mut Parser, min_prec: usize, stop: SyntaxKind) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
SyntaxKind::Text | SyntaxKind::MathText | SyntaxKind::MathShorthand => {
|
SyntaxKind::Text | SyntaxKind::MathText | SyntaxKind::MathShorthand => {
|
||||||
continuable = matches!(
|
continuable = !p.at(SyntaxKind::MathShorthand)
|
||||||
|
&& matches!(
|
||||||
math_class(p.current_text()),
|
math_class(p.current_text()),
|
||||||
None | Some(MathClass::Alphabetic)
|
None | Some(MathClass::Alphabetic)
|
||||||
);
|
);
|
||||||
|
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 &...,
|
1 - 0 thick &...,
|
||||||
) $
|
) $
|
||||||
|
|
||||||
|
--- math-shorthands-noncontinuable ---
|
||||||
|
// Test that shorthands are not continuable.
|
||||||
|
$ x >=(y) / z \
|
||||||
|
x >= (y) / z $
|
||||||
|
|
||||||
--- math-common-symbols ---
|
--- math-common-symbols ---
|
||||||
// Test common symbols.
|
// Test common symbols.
|
||||||
$ dot \ dots \ ast \ tilde \ star $
|
$ dot \ dots \ ast \ tilde \ star $
|
||||||
|
Loading…
x
Reference in New Issue
Block a user