Update u.rst to clarify truncate method's third argument behavior

Current wording "to preserve whole words" suggests setting the argument to ``true`` preserves words. However, the parameter is ``$cut`` (defaults to ``true`` for cutting at exact length), and ``false`` is required to preserve whole words.
This commit is contained in:
Always-Victorious
2026-01-15 15:43:42 +01:00
committed by GitHub
parent 94abd1c39b
commit 28c2606be7
+1 -1
View File
@@ -31,7 +31,7 @@ Truncating a string:
{{ 'Lorem ipsum'|u.truncate(8, '...') }}
Lorem...
The ``truncate`` method also accepts a third argument to preserve whole words:
By default, ``truncate`` cuts text at the exact length. Pass ``false`` as the third argument to preserve whole words:
.. code-block:: twig