qulogic/libgnt
Clone
Summary
Browse
Changes
Graph
Fix parsing XHTML.
2010-07-04, Sadrul Habib Chowdhury
4678d2312559
Parents
f1621d312a56
Children
47a58a8fcb6e
Fix parsing XHTML.
1 files changed, 4 insertions(+), 8 deletions(-)
+4
-8
gntutils.c
--- a/gntutils.c Tue Jun 15 17:12:48 2010 +0000
+++ b/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);