diff --git a/crates/typst/src/math/lr.rs b/crates/typst/src/math/lr.rs index f92afbd57..671aa7df9 100644 --- a/crates/typst/src/math/lr.rs +++ b/crates/typst/src/math/lr.rs @@ -122,10 +122,12 @@ impl LayoutMath for Packed { MathFragment::Glyph(glyph) => { let mut new = glyph.clone().into_variant(); new.mid_stretched = Some(false); + new.class = MathClass::Fence; *fragment = MathFragment::Variant(new); } MathFragment::Variant(variant) => { variant.mid_stretched = Some(false); + variant.class = MathClass::Fence; } _ => {} } diff --git a/tests/ref/math-lr-mid.png b/tests/ref/math-lr-mid.png index e4f1e6716..1e14759e6 100644 Binary files a/tests/ref/math-lr-mid.png and b/tests/ref/math-lr-mid.png differ diff --git a/tests/suite/math/delimited.typ b/tests/suite/math/delimited.typ index 98579947b..42a67c4ea 100644 --- a/tests/suite/math/delimited.typ +++ b/tests/suite/math/delimited.typ @@ -48,9 +48,9 @@ $ lr( --- math-lr-mid --- // Test middle functions $ { x mid(|) sum_(i=1)^oo phi_i (x) < 1 } \ - { integral |x| dif x + { integral |dot| mid(bar.v.double) - floor(hat(A) mid(|) { x mid(|) y } mid(|) A) } $ + floor(hat(I) mid(slash) { dot mid(|) dot } mid(|) I/n) } $ --- math-lr-unbalanced --- // Test unbalanced delimiters.