From 95a176f2bf7560d84e00b72f9ed468afe57c5894 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Fri, 25 Sep 2026 23:44:47 +0200 Subject: [PATCH] Fix the autoescape documentation about static expressions --- doc/tags/autoescape.rst | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/doc/tags/autoescape.rst b/doc/tags/autoescape.rst index 2708009c6..594bc6a07 100644 --- a/doc/tags/autoescape.rst +++ b/doc/tags/autoescape.rst @@ -46,7 +46,8 @@ Functions returning template data (like :doc:`macros` and .. note:: - Twig does not escape static expressions: + Twig does not escape string literals printed directly, but it escapes + variables, even when they were set to a literal: .. code-block:: html+twig @@ -54,7 +55,12 @@ Functions returning template data (like :doc:`macros` and {{ hello }} {{ "world" }} - Will be rendered "Hello **world**". + Will be rendered as: + + .. code-block:: html + + <strong>Hello</strong> + world .. note::