Document {#--#} as the replacement for the deprecated spaceless filter

This commit is contained in:
Fabien Potencier
2026-06-03 19:58:49 +02:00
parent 2a2f058f70
commit c29877f54a
+12
View File
@@ -1299,6 +1299,18 @@ the modifiers on one side of a tag or on both sides:
{{~ value }} </li>
{# outputs '<li>\nno spaces </li>' #}
To remove the whitespace between two tags, use an empty comment with the
whitespace trimming modifier on both sides:
.. code-block:: html+twig
<div>
{#--#}
<strong>foo</strong>
{#--#}
</div>
{# outputs '<div><strong>foo</strong></div>' #}
Extensions
----------