]> git.sur5r.net Git - glabels/commitdiff
Patch #820699: corrects interpretation of Object-text nodes when it consists of...
authorJim Evins <evins@snaught.com>
Mon, 13 Oct 2003 02:00:10 +0000 (02:00 +0000)
committerJim Evins <evins@snaught.com>
Mon, 13 Oct 2003 02:00:10 +0000 (02:00 +0000)
git-svn-id: https://glabels.svn.sourceforge.net/svnroot/glabels/trunk@312 f5e0f49d-192f-0410-a22d-a8d8700d0965

glabels2/src/xml-label.c

index 9df777b3684f50376a837b6d13c50acebede53f6..21c19d779314b01d75eb1a9814ad1ddda72e068e 100644 (file)
@@ -876,12 +876,18 @@ xml_parse_toplevel_span  (xmlNodePtr        node,
        for (child = node->xmlChildrenNode; child != NULL; child = child->next) {
 
                if (xmlNodeIsText (child)) {
-
-                       /* Literal text */
-                       text_node = g_new0 (glTextNode, 1);
-                       text_node->field_flag = FALSE;
-                       text_node->data = xmlNodeGetContent (child);
-                       text_nodes = g_list_append (text_nodes, text_node);
+                       gchar *data = xmlNodeGetContent (child); 
+
+                       /* Hack: if the first char is LF, it's a xml formatting string */
+                       if (data[0] != '\n') { 
+                               /* Literal text */
+                               text_node = g_new0 (glTextNode, 1);
+                               text_node->field_flag = FALSE;
+                               text_node->data = data;
+                               text_nodes = g_list_append (text_nodes, text_node);
+                       }
+                       else 
+                               g_free (data);
 
                } else if (xmlStrEqual (child->name, "Span")) {