Skip to content

Commit b82557d

Browse files
authored
[Frontend] Correct escape type for HTML attribute example
1 parent ceab14b commit b82557d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

frontend/server-data.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,13 @@ Fetch this in JavaScript:
3838
const user = JSON.parse(userRating.dataset.user);
3939
4040
There is no size limit for the value of the ``data-*`` attributes, so you can
41-
store any content. In Twig, use the ``html_attr`` escaping strategy to avoid messing
41+
store any content. In Twig, use the ``html`` escaping strategy to avoid messing
4242
with HTML attributes. For example, if your ``User`` object has some ``getProfileData()``
4343
method that returns an array, you could do the following:
4444

4545
.. code-block:: html+twig
4646

47-
<div data-user-profile="{{ app.user ? app.user.profileData|json_encode|e('html_attr') }}">
47+
<div data-user-profile="{{ app.user ? app.user.profileData|json_encode|e('html') }}">
4848
<!-- ... -->
4949
</div>
5050

0 commit comments

Comments
 (0)