From ef53238ae2ee77becc44bcb0b77c1c4daceca5af Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Mon, 22 Jan 2024 16:54:56 +0100 Subject: Mention that whitespace control is not allowed on `extends` in the book --- book/src/template_syntax.md | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'book') diff --git a/book/src/template_syntax.md b/book/src/template_syntax.md index 4bd9894..31b1eaa 100644 --- a/book/src/template_syntax.md +++ b/book/src/template_syntax.md @@ -328,6 +328,16 @@ blocks from the base template with those from the child template. Inside a block in a child template, the `super()` macro can be called to render the parent block's contents. +Because top-level content from the child template is thus ignored, the `extends` +tag doesn't support whitespace control: + +```html +{%- extends "base.html" +%} +``` + +The above code is rejected because we used `-` and `+`. For more information +about whitespace control, take a look [here](#whitespace-control). + ## HTML escaping Askama by default escapes variables if it thinks it is rendering HTML -- cgit