We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5b03057 commit 54366d7Copy full SHA for 54366d7
src/recipe/jinja.rs
@@ -129,7 +129,13 @@ impl Jinja {
129
if let Some(simple_expr) = strip_expression(template) {
130
// render as expression so that we know the type of the result
131
let expr = self.env.compile_expression(simple_expr)?;
132
- return Ok((expr.eval(self.context())?, true));
+ let evaled = expr.eval(self.context())?;
133
+ if evaled.as_str().is_some() {
134
+ // Make sure that the string stays a string by returning can_coerce: false
135
+ return Ok((evaled.to_str().unwrap().to_string().into(), false));
136
+ } else {
137
+ return Ok((expr.eval(self.context())?, true));
138
+ }
139
}
140
141
// Otherwise just render it as string
0 commit comments