diff --git a/src/pugixml.cpp b/src/pugixml.cpp index 90c677e..f447e97 100644 --- a/src/pugixml.cpp +++ b/src/pugixml.cpp @@ -3360,7 +3360,11 @@ PUGI__NS_BEGIN if (cursor->parent || PUGI__OPTSET(parse_fragment)) { - if (!PUGI__OPTSET(parse_embed_pcdata)) + if (PUGI__OPTSET(parse_embed_pcdata) && cursor->parent && !cursor->first_child && !cursor->value) + { + cursor->value = s; // Save the offset. + } + else { PUGI__PUSHNODE(node_pcdata); // Append a new node on the tree. @@ -3368,11 +3372,6 @@ PUGI__NS_BEGIN PUGI__POPNODE(); // Pop since this is a standalone. } - else - { - if (cursor->parent && !cursor->value) - cursor->value = s; // Save the offset. - } s = strconv_pcdata(s);