From 6904b23fb6e139608477d1d24ad8e8efe06041a5 Mon Sep 17 00:00:00 2001 From: Pascal CESCON - Amoifr Date: Thu, 7 May 2026 15:06:12 +0200 Subject: [PATCH] [Doc] Reword whitespace control note about first-newline removal The previous wording ("inherited from PHP") was misleading: Twig does not inherit anything from PHP, it deliberately implements the same behavior, like Jinja does. The behavior was already explained earlier in the same section, so just point back to it instead. --- doc/templates.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/templates.rst b/doc/templates.rst index 279c1b832f8..9fec7c20414 100644 --- a/doc/templates.rst +++ b/doc/templates.rst @@ -1221,7 +1221,7 @@ Twig supports two modifiers: * *Line whitespace trimming* via the ``~`` modifier: Removes all whitespace (excluding newlines). Using this modifier on the right disables the default - removal of the first newline inherited from PHP. + removal of the first newline mentioned above. The modifiers can be used on either side of the tags like in ``{%-`` or ``-%}`` and they consume all whitespace for that side of the tag. It is possible to use