diff --git a/book/src/template_syntax.md b/book/src/template_syntax.md index 689e979b..9c414d18 100644 --- a/book/src/template_syntax.md +++ b/book/src/template_syntax.md @@ -743,6 +743,11 @@ let t = RenderInPlace { s1: SectionOne { a: "a", b: "b" } }; assert_eq!(t.render().unwrap(), "Section 1: A=a\nB=b") ``` +Note that if your inner template like `SectionOne` renders HTML content, then you may want to +disable escaping when injecting it into an outer template, e.g. `{{ s1|safe }}`. +Otherwise it will render the HTML content literally, because +rinja [escapes HTML variables](#html-escaping) by default. + See the example [render in place](https://github.com/rinja-rs/rinja/blob/master/testing/tests/render_in_place.rs) using a vector of templates in a for block.