djc / askama

Type-safe, compiled Jinja-like templates for Rust
Apache License 2.0
3.43k stars 218 forks source link

Fix nested templates block #1029

Closed GuillaumeGomez closed 4 months ago

GuillaumeGomez commented 5 months ago

Fixes #1022.

Problem was that we were still rendering the content into the WritableBuffer.

GuillaumeGomez commented 5 months ago

And fixed clippy lints.

GuillaumeGomez commented 5 months ago

Mystery solved (for the missing trailing backline characters): I accidentaly removed child.flush_ws(def.ws2);. Much less diff in the tests now. \o/

rellfy commented 5 months ago

I can confirm this resolved an issue I had where contents from the template leaked into the block-fragmented child template. I added another test case here: https://github.com/djc/askama/pull/1032