summaryrefslogtreecommitdiff
path: root/crates
diff options
context:
space:
mode:
authorLU Jialin <luxxxlucy@gmail.com>2023-09-11 16:47:08 +0800
committerGitHub <noreply@github.com>2023-09-11 10:47:08 +0200
commitd056280165b981ef7a11f5bfb02417ef96760352 (patch)
tree3d835552f4b018dfe3714a88ef59ddaebbfe59ad /crates
parent71dccde031dedc285042257c7e16bafb152dde58 (diff)
Wrap into an equation when a Math expr is evaluated (#2081)
Diffstat (limited to 'crates')
-rw-r--r--crates/typst/src/eval/mod.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/crates/typst/src/eval/mod.rs b/crates/typst/src/eval/mod.rs
index fffedc9f..a6fd5e17 100644
--- a/crates/typst/src/eval/mod.rs
+++ b/crates/typst/src/eval/mod.rs
@@ -202,9 +202,10 @@ pub fn eval_string(
EvalMode::Markup => {
Value::Content(root.cast::<ast::Markup>().unwrap().eval(&mut vm)?)
}
- EvalMode::Math => {
- Value::Content(root.cast::<ast::Math>().unwrap().eval(&mut vm)?)
- }
+ EvalMode::Math => Value::Content((vm.items.equation)(
+ root.cast::<ast::Math>().unwrap().eval(&mut vm)?,
+ false,
+ )),
};
// Handle control flow.