]> git.mdlowis.com Git - proto/labwc.git/commitdiff
common/xml: parse CDATA as text
authortokyo4j <hrak1529@gmail.com>
Sun, 3 Aug 2025 07:09:18 +0000 (16:09 +0900)
committerJohan Malm <johanmalm@users.noreply.github.com>
Sun, 3 Aug 2025 14:05:53 +0000 (15:05 +0100)
Before this patch, <![CDATA[xxx]]> was ignored in many cases.

For example, this didn't work:

  <core>
    <gap><![CDATA[10]]></gap>
  </core>

src/common/xml.c

index df8c26e4a34d1fa1ab20f89aae472f8736174a51..797af9c0eb3d5418dbc3abdd9f9b0af7120eba15 100644 (file)
@@ -138,7 +138,8 @@ lab_xml_node_is_leaf(xmlNode *node)
                return false;
        }
        for (xmlNode *child = node->children; child; child = child->next) {
-               if (child->type != XML_TEXT_NODE) {
+               if (child->type != XML_TEXT_NODE
+                               && child->type != XML_CDATA_SECTION_NODE) {
                        return false;
                }
        }