From abbdf82823c780f4caf56a7cde53436f25b9134f Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Thu, 27 Aug 2026 13:07:41 +0200 Subject: [PATCH] Fix the html_attr documentation about iterables in data attributes --- doc/functions/html_attr.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/functions/html_attr.rst b/doc/functions/html_attr.rst index b80b31ee7..bfd6ffc76 100644 --- a/doc/functions/html_attr.rst +++ b/doc/functions/html_attr.rst @@ -124,10 +124,10 @@ Data Attributes --------------- For ``data-*`` attributes, a boolean ``true`` is converted to the string -``"true"``, and any non-scalar value is JSON-encoded. Two exceptions behave as -they do for any other attribute: an iterable is rendered as a token list, and -a ``Stringable`` object is cast to its string representation. When an object -is both, the iterable behavior wins. +``"true"``, and any non-scalar value is JSON-encoded, including arrays and +other iterables. The only exception is a ``Stringable`` object, which behaves +as it does for any other attribute: it is cast to its string representation, +or rendered as a token list when it is also iterable. .. code-block:: html+twig