Whitespace control for include not working
{%- include "a.html" -%}
<world>
<hello>
Produces
<hello>
<world>
Instead of
<hello><world>
The whitespace creates an issue in https://github.com/rust-lang/docs.rs/blob/cdc7a5367f4dcf6517e42378e3c9bd1f470bd947/templates/rustdoc/topbar.html#L6-L8 which creates an extra whitespace in docs.rs, although there are other methods to solve it, like using the html tags correctly but ideally the whitespace should be removed as well.

cc @jyn514
I believe the {%- and -%} of include should be handled differently where it not only trims the outer whitespace but also the inner ones https://github.com/Keats/tera/blob/b41e801b0449c8f8348276d4e1fe460c2d1bef0a/src/parser/whitespace.rs#L59
Another way is to allow using | trim for includes which I don't think is possible now.
// https://github.com/Keats/tera/issues/610
#[test]
fn can_remove_whitespace_include_outer() {
let mut tera = Tera::default();
tera.add_raw_templates(vec![
("a.html", "{%- include 'b.html' -%}\n<world>"),
("b.html", "<hello>"),
]).unwrap();
assert_eq!(tera.render("a.html", &Context::new()).unwrap(), "<hello><world>");
}
seems to pass. Can you tweak the test above to match your example? Github munches newlines.
@Keats I think the tests that you showed is incorrect (real world usage), shouldn't it have \n at the end? Files usually end with newlines right?
// https://github.com/Keats/tera/issues/610
#[test]
fn can_remove_whitespace_include_outer() {
let mut tera = Tera::default();
tera.add_raw_templates(vec![
("a.html", "{%- include 'b.html' -%}\n<world>\n"),
("b.html", "<hello>\n"),
]).unwrap();
assert_eq!(tera.render("a.html", &Context::new()).unwrap(), "<hello><world>");
}