From c29877f54ab9aa6e35ecb338debf29b2f9589fa0 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Wed, 3 Jun 2026 19:58:49 +0200 Subject: [PATCH] Document {#--#} as the replacement for the deprecated spaceless filter --- doc/templates.rst | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/doc/templates.rst b/doc/templates.rst index 0b38d5bcc..9070c14c2 100644 --- a/doc/templates.rst +++ b/doc/templates.rst @@ -1299,6 +1299,18 @@ the modifiers on one side of a tag or on both sides: {{~ value }} {# outputs '
  • \nno spaces
  • ' #} +To remove the whitespace between two tags, use an empty comment with the +whitespace trimming modifier on both sides: + +.. code-block:: html+twig + +
    + {#--#} + foo + {#--#} +
    + {# outputs '
    foo
    ' #} + Extensions ----------