diff options
| author | LU Jialin <luxxxlucy@gmail.com> | 2023-09-11 16:47:08 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-09-11 10:47:08 +0200 |
| commit | d056280165b981ef7a11f5bfb02417ef96760352 (patch) | |
| tree | 3d835552f4b018dfe3714a88ef59ddaebbfe59ad /crates | |
| parent | 71dccde031dedc285042257c7e16bafb152dde58 (diff) | |
Wrap into an equation when a Math expr is evaluated (#2081)
Diffstat (limited to 'crates')
| -rw-r--r-- | crates/typst/src/eval/mod.rs | 7 |
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. |
