comparison src/util.c @ 13834:378bba5011e7

[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: Tailor Script <tailor@pidgin.im>
author Richard Laager <rlaager@wiktel.com>
date Mon, 19 Jun 2006 05:57:11 +0000
parents b6967e51f6c4
children 7d513e44201b
comparison
equal deleted inserted replaced
13833:571aebbe5ec6 13834:378bba5011e7
1340 } 1340 }
1341 while(*q && *q != '\"' && *q != '\'' && (space_allowed || *q != ' ')) { 1341 while(*q && *q != '\"' && *q != '\'' && (space_allowed || *q != ' ')) {
1342 face = g_string_append_c(face, *q); 1342 face = g_string_append_c(face, *q);
1343 q++; 1343 q++;
1344 } 1344 }
1345 g_string_append_printf(style, "font-family: %s; ", face->str); 1345 g_string_append_printf(style, "font-family: %s; ", g_strstrip(face->str));
1346 g_string_free(face, TRUE); 1346 g_string_free(face, TRUE);
1347 p = q; 1347 p = q;
1348 } else if(!g_ascii_strncasecmp(p, "size=", strlen("size="))) { 1348 } else if(!g_ascii_strncasecmp(p, "size=", strlen("size="))) {
1349 const char *q = p + strlen("size="); 1349 const char *q = p + strlen("size=");
1350 int sz; 1350 int sz;
1390 pt = g_new0(struct gaim_parse_tag, 1); 1390 pt = g_new0(struct gaim_parse_tag, 1);
1391 pt->src_tag = "font"; 1391 pt->src_tag = "font";
1392 pt->dest_tag = "span"; 1392 pt->dest_tag = "span";
1393 tags = g_list_prepend(tags, pt); 1393 tags = g_list_prepend(tags, pt);
1394 if(style->len) 1394 if(style->len)
1395 g_string_append_printf(xhtml, "<span style='%s'>", style->str); 1395 g_string_append_printf(xhtml, "<span style='%s'>", g_strstrip(style->str));
1396 else 1396 else
1397 pt->ignore = TRUE; 1397 pt->ignore = TRUE;
1398 g_string_free(style, TRUE); 1398 g_string_free(style, TRUE);
1399 continue; 1399 continue;
1400 } 1400 }
1410 q++; 1410 q++;
1411 while(*q && *q != '\"' && *q != '\'' && *q != ' ') { 1411 while(*q && *q != '\"' && *q != '\'' && *q != ' ') {
1412 color = g_string_append_c(color, *q); 1412 color = g_string_append_c(color, *q);
1413 q++; 1413 q++;
1414 } 1414 }
1415 g_string_append_printf(xhtml, "<span style='background: %s;'>", color->str); 1415 g_string_append_printf(xhtml, "<span style='background: %s;'>", g_strstrip(color->str));
1416 g_string_free(color, TRUE); 1416 g_string_free(color, TRUE);
1417 if ((c = strchr(c, '>')) != NULL) 1417 if ((c = strchr(c, '>')) != NULL)
1418 c++; 1418 c++;
1419 else 1419 else
1420 c = p; 1420 c = p;