mirror of
https://github.com/typst/typst
synced 2025-05-14 04:56:26 +08:00
Don't throw away arguments after non-function math call
This commit is contained in:
parent
87a89e77e5
commit
6ca240508e
@ -931,9 +931,16 @@ impl ast::FuncCall {
|
|||||||
if let Value::Func(callee) = callee {
|
if let Value::Func(callee) = callee {
|
||||||
Ok(self.eval_with_callee(vm, callee)?.display_in_math())
|
Ok(self.eval_with_callee(vm, callee)?.display_in_math())
|
||||||
} else {
|
} else {
|
||||||
Ok(callee.display_in_math()
|
let mut body = (vm.items.math_atom)('('.into());
|
||||||
+ (vm.items.math_atom)("(".into())
|
let mut args = self.args().eval(vm)?;
|
||||||
+ (vm.items.math_atom)(")".into()))
|
for (i, arg) in args.all::<Content>()?.into_iter().enumerate() {
|
||||||
|
if i > 0 {
|
||||||
|
body += (vm.items.math_atom)(','.into());
|
||||||
|
}
|
||||||
|
body += arg;
|
||||||
|
}
|
||||||
|
body += (vm.items.math_atom)(')'.into());
|
||||||
|
Ok(callee.display_in_math() + body)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user