diff --git a/crates/typst-library/src/math/fragment.rs b/crates/typst-library/src/math/fragment.rs index 8baea9132..8e0510746 100644 --- a/crates/typst-library/src/math/fragment.rs +++ b/crates/typst-library/src/math/fragment.rs @@ -216,7 +216,7 @@ impl GlyphFragment { pub fn with_id(ctx: &MathContext, c: char, id: GlyphId, span: Span) -> Self { let class = match c { ':' => Some(MathClass::Relation), - '⋯' | '⋱' | '⋰' | '⋮' => Some(MathClass::Normal), + '.' | '/' | '⋯' | '⋱' | '⋰' | '⋮' => Some(MathClass::Normal), _ => unicode_math_class::class(c), }; let mut fragment = Self { diff --git a/tests/ref/math/class.png b/tests/ref/math/class.png index f339c4f1c..7365dc3e1 100644 Binary files a/tests/ref/math/class.png and b/tests/ref/math/class.png differ diff --git a/tests/typ/math/class.typ b/tests/typ/math/class.typ index 188e7d90a..0c9fa32b4 100644 --- a/tests/typ/math/class.typ +++ b/tests/typ/math/class.typ @@ -31,3 +31,7 @@ $ a dotsq b \ #let normal = math.class.with("normal") #let pluseq = $class("binary", normal(+) normal(=))$ $ a pluseq 5 $ + +--- +// Test exceptions. +$ sqrt(3)\/2 quad d_0.d_1d_2 dots $ \ No newline at end of file diff --git a/tests/typ/math/matrix-alignment.typ b/tests/typ/math/matrix-alignment.typ index fd149dd88..0b3aa4564 100644 --- a/tests/typ/math/matrix-alignment.typ +++ b/tests/typ/math/matrix-alignment.typ @@ -42,10 +42,13 @@ $ mat( --- // Test #460 equations. +#let stop = { + math.class("punctuation",$.$) +} $ mat(&a+b,c;&d, e) $ $ mat(&a+b&,c;&d&, e) $ $ mat(&&&a+b,c;&&&d, e) $ -$ mat(.&a+b&.,c;.....&d&....., e) $ +$ mat(stop &a+b&stop,c;...stop stop&d&...stop stop, e) $ --- // Test #454 equations.