aboutsummaryrefslogtreecommitdiffstats
path: root/askama_derive
diff options
context:
space:
mode:
authorLibravatar Dirkjan Ochtman <dirkjan@ochtman.nl>2018-10-19 20:20:59 +0200
committerLibravatar Dirkjan Ochtman <dirkjan@ochtman.nl>2018-10-20 20:34:47 +0200
commit4fa029f26fd78b648024be1a2de6a143936c470d (patch)
treed00e8b810ba1061aaa352e417cac4cfcb44536ea /askama_derive
parent5ffe3de3115fe9d418a15e7813934e1fbe4ccd97 (diff)
downloadaskama-4fa029f26fd78b648024be1a2de6a143936c470d.tar.gz
askama-4fa029f26fd78b648024be1a2de6a143936c470d.tar.bz2
askama-4fa029f26fd78b648024be1a2de6a143936c470d.zip
Take reference of unescaped expressions directly (fixes #132)
Diffstat (limited to 'askama_derive')
-rw-r--r--askama_derive/src/generator.rs5
1 files changed, 2 insertions, 3 deletions
diff --git a/askama_derive/src/generator.rs b/askama_derive/src/generator.rs
index 4f83b07..bc009f9 100644
--- a/askama_derive/src/generator.rs
+++ b/askama_derive/src/generator.rs
@@ -586,14 +586,13 @@ impl<'a> Generator<'a> {
use self::DisplayWrap::*;
use super::input::EscapeMode::*;
- buf.writeln("write!(writer, \"{}\", &{");
+ buf.writeln("write!(writer, \"{}\", &");
buf.write(&match (wrapped, &self.input.escaping) {
(Wrapped, &Html) | (Wrapped, &None) | (Unwrapped, &None) => expr_buf.buf,
(Unwrapped, &Html) => format!("::askama::MarkupDisplay::from(&{})", expr_buf.buf),
});
buf.writeln("");
- buf.dedent();
- buf.writeln("})?;");
+ buf.writeln(")?;");
}
fn write_lit(&mut self, buf: &mut Buffer, lws: &'a str, val: &str, rws: &'a str) {