/*************************************************************** * wrap_cdata * * Wrap `` * → `` * * - `` * → `` * (embedded `]]>` is split so the outer CDATA stays valid) * * Behavior: * - For each `` and `` * match (case-insensitive): * 1. Extract `attrs` and inner `body`. * 2. Trim the body for inspection. * 3. If it already contains `` inside the body with * `]]]]>` to break nested closers. * - wrap the result with ``. * * Notes: * - This is designed for XML/XHTML serialization where the * content of `