From c6d35123b955de9a0a7080f4b78fee3ec7b32ef1 Mon Sep 17 00:00:00 2001 From: alexpozzi Date: Mon, 13 May 2024 17:49:41 +0200 Subject: [PATCH] Add missing XML serializer's CDATA options --- components/serializer.rst | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/components/serializer.rst b/components/serializer.rst index 2d1ea2c7637..1c86a111084 100644 --- a/components/serializer.rst +++ b/components/serializer.rst @@ -1200,11 +1200,17 @@ Option Description ``remove_empty_tags`` If set to true, removes all empty tags in the ``false`` generated XML ``cdata_wrapping`` If set to false, will not wrap any value ``true`` - containing one of the following characters ( - ``<``, ``>``, ``&``) in `a CDATA section`_ like - following: ```` + matching the ``cdata_wrapping_pattern`` regex in + `a CDATA section`_ like following: + ```` +``cdata_wrapping_pattern`` A regular expression pattern to determine if a ``/[<>&]/`` + value should be wrapped in a CDATA section ============================== ================================================= ========================== +.. versionadded:: 7.1 + + The `cdata_wrapping_pattern` option was introduced in Symfony 7.1. + Example with custom ``context``:: use Symfony\Component\Serializer\Encoder\XmlEncoder;