[gaim-migrate @ 16283]

Mon, 19 Jun 2006 05:57:11 +0000

author
Brian Chu <roast@users.sourceforge.net>
date
Mon, 19 Jun 2006 05:57:11 +0000
changeset 13836
43be98fd1be0
parent 13835
86dea5f9cffa
child 13837
6a6368224b8b

[gaim-migrate @ 16283]
SF Patch #1500688 from Brian Chu (roast)

He already committed this to his soc-2006-file-loggers branch.

Here's the patch description:

In util.c, gaim_markup_html_to_xhtml() doesn't trim
spaces of parsed background colors, parsed font names,
or the end result for styles (which inserted spaces for
the purpose of many span.style attributes).

For example, things like this get written to the log:

<span style='font-size: small; '>

Things like the following this _can_ written to the log
given a tag like this:

<font face=" Comic Sans MS ">
<span style='font-family: Comic Sans MS
; '>

Same for: <body bgcolor=" Red ">
<span style='background: Red ;'>

committer: Richard Laager <rlaager@pidgin.im>

COPYRIGHT file | annotate | diff | comparison | revisions
src/util.c file | annotate | diff | comparison | revisions
--- a/COPYRIGHT	Mon Jun 19 05:39:30 2006 +0000
+++ b/COPYRIGHT	Mon Jun 19 05:57:11 2006 +0000
@@ -51,6 +51,7 @@
 Christophe Chapuis
 Ka-Hing Cheung
 Sadrul Habib Chowdhury
+Brian Chu
 Arturo Cisneros, Jr.
 Vincas Ciziunas
 Jonathan Clark
--- a/src/util.c	Mon Jun 19 05:39:30 2006 +0000
+++ b/src/util.c	Mon Jun 19 05:57:11 2006 +0000
@@ -1342,7 +1342,7 @@
 								face = g_string_append_c(face, *q);
 								q++;
 							}
-							g_string_append_printf(style, "font-family: %s; ", face->str);
+							g_string_append_printf(style, "font-family: %s; ", g_strstrip(face->str));
 							g_string_free(face, TRUE);
 							p = q;
 						} else if(!g_ascii_strncasecmp(p, "size=", strlen("size="))) {
@@ -1392,7 +1392,7 @@
 					pt->dest_tag = "span";
 					tags = g_list_prepend(tags, pt);
 					if(style->len)
-						g_string_append_printf(xhtml, "<span style='%s'>", style->str);
+						g_string_append_printf(xhtml, "<span style='%s'>", g_strstrip(style->str));
 					else
 						pt->ignore = TRUE;
 					g_string_free(style, TRUE);
@@ -1412,7 +1412,7 @@
 								color = g_string_append_c(color, *q);
 								q++;
 							}
-							g_string_append_printf(xhtml, "<span style='background: %s;'>", color->str);
+							g_string_append_printf(xhtml, "<span style='background: %s;'>", g_strstrip(color->str));
 							g_string_free(color, TRUE);
 							if ((c = strchr(c, '>')) != NULL)
 								c++;

mercurial