From 9420f3e2551459ec6409b5b00f06c09f873b44ac Mon Sep 17 00:00:00 2001 From: Richard Hughes Date: Thu, 25 Sep 2014 12:51:05 +0100 Subject: Respect AS_NODE_FROM_XML_FLAG_LITERAL_TEXT when dealing with comments --- libappstream-glib/as-node.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'libappstream-glib/as-node.c') diff --git a/libappstream-glib/as-node.c b/libappstream-glib/as-node.c index dc8665c..d6be1dc 100644 --- a/libappstream-glib/as-node.c +++ b/libappstream-glib/as-node.c @@ -370,7 +370,7 @@ as_node_to_xml_string (GString *xml, g_string_append (xml, "\n"); if ((flags & AS_NODE_TO_XML_FLAG_FORMAT_INDENT) > 0) as_node_add_padding (xml, depth - depth_offset); - g_string_append_printf (xml, "", comment); + g_string_append_printf (xml, "", comment); if ((flags & AS_NODE_TO_XML_FLAG_FORMAT_MULTILINE) > 0) g_string_append (xml, "\n"); } @@ -636,7 +636,9 @@ as_node_passthrough_cb (GMarkupParseContext *context, found = g_strrstr (text, "-->"); if (found != NULL) *found = '\0'; - tmp = g_strstrip (text + 4); + tmp = text + 4; + if ((helper->flags & AS_NODE_FROM_XML_FLAG_LITERAL_TEXT) == 0) + tmp = g_strstrip ((gchar *) tmp); if (tmp == NULL || tmp[0] == '\0') return; as_node_add_attribute (helper->current, "@comment-tmp", tmp, -1); -- cgit v1.2.1