From 705d5d2ae91a508c7c1be057f4f4228e5e537c74 Mon Sep 17 00:00:00 2001 From: AndoniLarz Date: Sat, 1 Apr 2023 16:08:11 +0200 Subject: [PATCH] [Serializer] Add documentation about a new XmlEncoder CDATA wrapping opt-out context option --- components/serializer.rst | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/components/serializer.rst b/components/serializer.rst index 62f8af323b1..febc23e3495 100644 --- a/components/serializer.rst +++ b/components/serializer.rst @@ -1206,8 +1206,16 @@ Option Description ``save_options`` XML saving `options with libxml`_ ``0`` ``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: ```` ============================== ================================================= ========================== +.. versionadded:: 6.4 + + The `cdata_wrapping` option was introduced in Symfony 6.4. + Example with custom ``context``:: use Symfony\Component\Serializer\Encoder\XmlEncoder; @@ -1936,3 +1944,4 @@ Learn more .. _`data URI`: https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs .. _seld/jsonlint: https://github.com/Seldaek/jsonlint .. _$flags: https://www.php.net/manual/en/json.constants.php +.. _`a CDATA section`: https://en.wikipedia.org/wiki/CDATA