summaryrefslogtreecommitdiff
path: root/crates
diff options
context:
space:
mode:
authorMax <me@mkor.je>2024-12-20 10:15:18 +0000
committerGitHub <noreply@github.com>2024-12-20 10:15:18 +0000
commitc3334a55fe53253b55943a4b713bff532e876d95 (patch)
tree3d58c97eefb14d3705ea527cb4dc967bf22268fe /crates
parent6c2d54bbe3df70670afef6d3f61750daeb2adf34 (diff)
Fix arbitrarily nested equations in the base of `math.attach` (#5613)
Diffstat (limited to 'crates')
-rw-r--r--crates/typst-layout/src/math/attach.rs2
-rw-r--r--crates/typst-library/src/math/attach.rs2
2 files changed, 2 insertions, 2 deletions
diff --git a/crates/typst-layout/src/math/attach.rs b/crates/typst-layout/src/math/attach.rs
index 0f9090f7..cda03315 100644
--- a/crates/typst-layout/src/math/attach.rs
+++ b/crates/typst-layout/src/math/attach.rs
@@ -161,7 +161,7 @@ fn stretch_size(
) -> Option<Smart<Rel<Length>>> {
// Extract from an EquationElem.
let mut base = elem.base();
- if let Some(equation) = base.to_packed::<EquationElem>() {
+ while let Some(equation) = base.to_packed::<EquationElem>() {
base = equation.body();
}
diff --git a/crates/typst-library/src/math/attach.rs b/crates/typst-library/src/math/attach.rs
index 74eabd10..f3c7ea99 100644
--- a/crates/typst-library/src/math/attach.rs
+++ b/crates/typst-library/src/math/attach.rs
@@ -48,7 +48,7 @@ impl Packed<AttachElem> {
pub fn merge_base(&self) -> Option<Self> {
// Extract from an EquationElem.
let mut base = self.base();
- if let Some(equation) = base.to_packed::<EquationElem>() {
+ while let Some(equation) = base.to_packed::<EquationElem>() {
base = equation.body();
}