Skip to content

Commit 53aeff4

Browse files
committed
Add missing XML serializer's CDATA options
1 parent 442e506 commit 53aeff4

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

components/serializer.rst

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1200,15 +1200,21 @@ Option Description
12001200
``remove_empty_tags`` If set to true, removes all empty tags in the ``false``
12011201
generated XML
12021202
``cdata_wrapping`` If set to false, will not wrap any value ``true``
1203-
containing one of the following characters (
1204-
``<``, ``>``, ``&``) in `a CDATA section`_ like
1205-
following: ``<![CDATA[...]]>``
1203+
matching the `cdata_wrapping_pattern`_ regex in
1204+
`a CDATA section`_ like following:
1205+
``<![CDATA[...]]>``
1206+
``cdata_wrapping_pattern`` A regular expression pattern to determine if a ``/[<>&]/``
1207+
value should be wrapped in a CDATA section
12061208
============================== ================================================= ==========================
12071209

12081210
.. versionadded:: 6.4
12091211

12101212
The `cdata_wrapping` option was introduced in Symfony 6.4.
12111213

1214+
.. versionadded:: 7.1
1215+
1216+
The `cdata_wrapping_pattern` option was introduced in Symfony 7.1.
1217+
12121218
Example with custom ``context``::
12131219

12141220
use Symfony\Component\Serializer\Encoder\XmlEncoder;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy