summaryrefslogtreecommitdiffstats
path: root/src/xml/repr-io.cpp
diff options
context:
space:
mode:
authorMarc Jeanmougin <marc@jeanmougin.fr>2017-10-28 10:33:14 +0000
committerMarc Jeanmougin <marc@jeanmougin.fr>2017-10-28 10:33:14 +0000
commitfa9ae5fb7c249a4c96a06bfef905c73cbb17bc3d (patch)
tree8c06d1d61a79a74381cb75a925ef50dd598da8c2 /src/xml/repr-io.cpp
parentTrying libFuzzer (diff)
parentFix XML text parsing bug. (diff)
downloadinkscape-fa9ae5fb7c249a4c96a06bfef905c73cbb17bc3d.tar.gz
inkscape-fa9ae5fb7c249a4c96a06bfef905c73cbb17bc3d.zip
Merge branch 'master' of https://gitlab.com/inkscape/inkscape
Diffstat (limited to 'src/xml/repr-io.cpp')
-rw-r--r--src/xml/repr-io.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/xml/repr-io.cpp b/src/xml/repr-io.cpp
index 725b313b1..2ff9d4776 100644
--- a/src/xml/repr-io.cpp
+++ b/src/xml/repr-io.cpp
@@ -561,7 +561,10 @@ static Node *sp_repr_svg_read_node (Document *xml_doc, xmlNodePtr node, const gc
return NULL; // empty text node
}
- bool preserve = (xmlNodeGetSpacePreserve (node) == 1);
+ // Since libxml2 2.9.0, only element nodes are checked, thus check parent.
+ // Note: this only handles XML's rules for white space. SVG's specific rules
+ // are handled in sp-string.cpp.
+ bool preserve = (xmlNodeGetSpacePreserve (node->parent) == 1);
xmlChar *p;
for (p = node->content; *p && g_ascii_isspace (*p) && !preserve; p++)