evolution-rss r435 - in trunk: . src



Author: lucilanga
Date: Thu Feb  5 20:03:56 2009
New Revision: 435
URL: http://svn.gnome.org/viewvc/evolution-rss?rev=435&view=rev

Log:
2008-02-05  Lucian Langa  <lucilanga gnome org>

* src/parser.c: (parse_channel_line)
do not decode, parse, or fix images
if feed = comment
* src/parser.c: (layer_find_tag)
accept node->children->type == 3 (text)

Modified:
   trunk/ChangeLog
   trunk/src/parser.c
   trunk/src/rss.c

Modified: trunk/src/parser.c
==============================================================================
--- trunk/src/parser.c	(original)
+++ trunk/src/parser.c	Thu Feb  5 20:03:56 2009
@@ -491,10 +491,11 @@
 		}
                 if (strcasecmp (node->name, match)==0) {
                         if (node->children != NULL) {
-				if (node->children->type == 1
+				if (node->children->type == 1			//XML_NODE_ELEMENT
+					|| node->children->type == 3		//XML_NODE_TEXT
 					|| node->children->next != NULL) {
 #ifdef RDF_DEBUG
-				g_print("NODE DUMP:%s\n", xmlNodeGetContent(node->children->next));
+				g_print("NODE DUMP:%s|\n", xmlNodeGetContent(node->children->next));
 #endif
 				len = xmlNodeDump(buf, node->doc, node->children, 0, 0);
 				content = g_strdup_printf("%s", xmlBufferContent(buf));
@@ -919,26 +920,30 @@
                         gchar *tmp = decode_utf8_entities(b);
                         g_free(b);
 
-                        xmlDoc *src = (xmlDoc *)parse_html_sux(tmp, strlen(tmp));
-                        if (src)
-                        {
-                                xmlNode *doc = (xmlNode *)src;
-
-                                while (doc = html_find(doc, "img"))
-                                {
-                                        gchar *name = NULL;
-                                        xmlChar *url = xmlGetProp(doc, "src");
-                                        if (url) {
-                                                if (name = fetch_image(url))
-                                                        xmlSetProp(doc, "src", name);
-                                                xmlFree(url);
-                                        }
-                                }
-                                xmlDocDumpMemory(src, &buff, &size);
-                                xmlFree(src);
-                        }
-                        g_free(tmp);
-                        b=buff;
+			if (feed_name) {
+                        	xmlDoc *src = (xmlDoc *)parse_html_sux(tmp, strlen(tmp));
+                        	if (src)
+                        	{
+                                	xmlNode *doc = (xmlNode *)src;
+
+                                	while (doc = html_find(doc, "img"))
+                                	{
+                                        	gchar *name = NULL;
+                                        	xmlChar *url = xmlGetProp(doc, "src");
+                                        	if (url) {
+                                                	if (name = fetch_image(url))
+                                                        	xmlSetProp(doc, "src", name);
+                                                	xmlFree(url);
+                                        	}
+                                	}
+                                	xmlDocDumpMemory(src, &buff, &size);
+                                	xmlFree(src);
+                        	}
+                        	g_free(tmp);
+                        	b=buff;
+			}
+			else
+				b = tmp;
 		}
 
 		create_feed *CF = g_new0(create_feed, 1);	

Modified: trunk/src/rss.c
==============================================================================
--- trunk/src/rss.c	(original)
+++ trunk/src/rss.c	Thu Feb  5 20:03:56 2009
@@ -4158,14 +4158,14 @@
         GString *comments = g_string_new(NULL);
         for (i=0; NULL != (el = g_array_index(r->item, xmlNodePtr, i)); i++) {
                 CF = parse_channel_line(el->children, NULL, NULL);
-        print_cf(CF);
+        ///print_cf(CF);
 //			g_string_append_printf (comments,
 //				"<br><div style=\"border: solid #%06x 1px; background-color: #%06x; color: #%06x;\">\n",
 //				frame_colour & 0xffffff, content_colour & 0xffffff, text_colour & 0xffffff);
                 g_string_append_printf(comments, "<tr><td><table cellpading=0 cellspacing=0 border=1 width=100%>");
                 g_string_append_printf(comments,
-                        "<tr><td><table border=0 width=\"100%%\" cellspacing=4 cellpadding=4>");
-		g_string_append_printf (comments, "<tr><td bgcolor=\"%06x\"><table width=100%%><tr><td><b><a href=%s>%s</b></td><td align=right>%s</td></tr></table></td></tr>", 
+                        "<tr><td><table border=0 width=\"100%%\" cellspacing=2 cellpadding=0>");
+		g_string_append_printf (comments, "<tr><td bgcolor=\"%06x\"><table width=100%% cellspacing=2 cellspadding=0><tr><td><b><a href=%s>%s</b></td><td align=right>%s</td></tr></table></td></tr>", 
 				content_colour & 0xEDECEB & 0xffffff,
 				CF->website, CF->subj, CF->date);
                 g_string_append_printf(comments, "<tr><td colspan=2>%s</td></tr>", CF->body);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]