From 73136d3583c343c0701c7de6ec53bbab61fc2efc Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Wed, 25 Apr 2012 10:34:12 +0200 Subject: [PATCH] added a note about auto-escaping and the embed tag We cannot use the parent template to guess the auto-escaping strategy either as it can be any valid expression, for which we have the real value only at runtime (auto-escaping happening at compilation time). --- doc/tags/embed.rst | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-) diff --git a/doc/tags/embed.rst b/doc/tags/embed.rst index e69d65c..b75f557 100644 --- a/doc/tags/embed.rst +++ b/doc/tags/embed.rst @@ -145,4 +145,12 @@ The ``embed`` tag takes the exact same arguments as the ``include`` tag: ... {% endembed %} +.. warning:: + + As embedded templates do not have "names", auto-escaping strategies based + on the template "filename" won't work as expected if you change the + context (for instance, if you embed a CSS/JavaScript template into an HTML + one). In that case, explicitly set the default auto-escaping strategy with + the ``autoescape`` tag. + .. seealso:: :doc:`include<../tags/include>` -- 1.7.2.5