changeset 30240:a472bc05fa55

Fix parsing XHTML.
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Sun, 04 Jul 2010 02:12:51 +0000
parents f55609d9bea5
children b258ffa87424
files finch/libgnt/gntutils.c
diffstat 1 files changed, 4 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/finch/libgnt/gntutils.c	Sat Jul 03 23:48:50 2010 +0000
+++ b/finch/libgnt/gntutils.c	Sun Jul 04 02:12:51 2010 +0000
@@ -385,7 +385,6 @@
 	const char *name;
 	char *content;
 	xmlNode *ch;
-	gboolean processed = FALSE;
 	char *url = NULL;
 	gboolean insert_nl_s = FALSE, insert_nl_e = FALSE;
 
@@ -426,17 +425,14 @@
 
 	for (ch = node->children; ch; ch = ch->next) {
 		if (ch->type == XML_ELEMENT_NODE) {
-			processed = TRUE;
 			util_parse_html_to_tv(ch, tv, flag);
+		} else if (ch->type == XML_TEXT_NODE) {
+			content = (char*)xmlNodeGetContent(ch);
+			gnt_text_view_append_text_with_flags(tv, content, flag);
+			xmlFree(content);
 		}
 	}
 
-	if (!processed) {
-		content = (char*)xmlNodeGetContent(node);
-		gnt_text_view_append_text_with_flags(tv, content, flag);
-		xmlFree(content);
-	}
-
 	if (url) {
 		char *href = g_strdup_printf(" (%s)", url);
 		gnt_text_view_append_text_with_flags(tv, href, flag);