pidgin: 9516977f: Fix parsing XHTML.

sadrul at pidgin.im sadrul at pidgin.im
Sat Jul 3 22:10:51 EDT 2010


----------------------------------------------------------------------
Revision: 9516977f6181bc776a77f42a548b05b17dfbcfec
Parent:   a4290ec72723df07b95a33743c09a15533b590fb
Author:   sadrul at pidgin.im
Date:     07/03/10 22:12:51
Branch:   im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/9516977f6181bc776a77f42a548b05b17dfbcfec

Changelog: 

Fix parsing XHTML.

Changes against parent a4290ec72723df07b95a33743c09a15533b590fb

  patched  finch/libgnt/gntutils.c

-------------- next part --------------
============================================================
--- finch/libgnt/gntutils.c	ebdd83522f2e3760dda578913b95387ad9f3427e
+++ finch/libgnt/gntutils.c	031bd6ec2bb227d2a283bb874ab87e14f0b109e0
@@ -385,7 +385,6 @@ util_parse_html_to_tv(xmlNode *node, Gnt
 	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 @@ util_parse_html_to_tv(xmlNode *node, Gnt
 
 	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);


More information about the Commits mailing list