diff options
author | Richard Hughes <richard@hughsie.com> | 2014-09-25 12:51:05 +0100 |
---|---|---|
committer | Richard Hughes <richard@hughsie.com> | 2014-09-25 12:51:05 +0100 |
commit | 9420f3e2551459ec6409b5b00f06c09f873b44ac (patch) | |
tree | b41f0e98adbdb92299d51996220e812babcbb409 /libappstream-glib/as-node.c | |
parent | 96d32a21269b37b7f3aadf2b5ba977e2c8995e88 (diff) | |
download | appstream-glib-9420f3e2551459ec6409b5b00f06c09f873b44ac.tar.gz |
Respect AS_NODE_FROM_XML_FLAG_LITERAL_TEXT when dealing with comments
Diffstat (limited to 'libappstream-glib/as-node.c')
-rw-r--r-- | libappstream-glib/as-node.c | 6 |
1 files changed, 4 insertions, 2 deletions
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, "<!-- %s -->", comment); + g_string_append_printf (xml, "<!--%s-->", 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); |