We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
else
for
Tera v1.19.1 fails to strip whitespace in the else branch of a for loop. I.e., this template...
v1.19.1
{% for x in [] -%} {% else -%} B {% endfor -%}
...produces \nB\n when it should produce B\n. Here's a failing test:
\nB\n
B\n
//! ```cargo //! [dependencies.tera] //! version = "=1.19.1" //! ``` use tera::{Context, Tera}; #[test] fn can_remove_whitespace_for_else() { let mut tera = Tera::default(); tera.add_raw_templates(vec![ ("a.html", "{% for x in [] -%}{% else -%}\nB\n{% endfor -%}"), ]).unwrap(); assert_eq!(tera.render("a.html", &Context::new()).unwrap(), "B\n"); }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Tera
v1.19.1
fails to strip whitespace in theelse
branch of afor
loop. I.e., this template......produces
\nB\n
when it should produceB\n
. Here's a failing test:The text was updated successfully, but these errors were encountered: