diff options
Diffstat (limited to 'askama_derive')
-rw-r--r-- | askama_derive/src/generator.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/askama_derive/src/generator.rs b/askama_derive/src/generator.rs index d0ac030..b6b5146 100644 --- a/askama_derive/src/generator.rs +++ b/askama_derive/src/generator.rs @@ -748,7 +748,7 @@ impl<'a> Generator<'a> { if let Expr::Var(name) = *obj { if name == "loop" { if attr == "index" { - buf.write("_loop_index + 1"); + buf.write("(_loop_index + 1)"); return DisplayWrap::Unwrapped; } else if attr == "index0" { buf.write("_loop_index"); |