aboutsummaryrefslogtreecommitdiffstats
path: root/askama_shared
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--askama_shared/src/generator.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/askama_shared/src/generator.rs b/askama_shared/src/generator.rs
index a37ca7c..3a91e3c 100644
--- a/askama_shared/src/generator.rs
+++ b/askama_shared/src/generator.rs
@@ -717,10 +717,11 @@ impl<'a, S: std::hash::BuildHasher> Generator<'a, S> {
}
names.write(arg);
- values.write("&");
+ values.write("&(");
values.write(&self.visit_expr_root(args.get(i).ok_or_else(|| {
CompileError::String(format!("macro '{}' takes more than {} arguments", name, i))
})?)?);
+ values.write(")");
self.locals.insert(arg);
}
@@ -944,7 +945,7 @@ impl<'a, S: std::hash::BuildHasher> Generator<'a, S> {
let expression = match wrapped {
Wrapped => expr_buf.buf,
Unwrapped => format!(
- "::askama::MarkupDisplay::new_unsafe(&{}, {})",
+ "::askama::MarkupDisplay::new_unsafe(&({}), {})",
expr_buf.buf, self.input.escaper
),
};