Mercurial > pidgin.yaz
comparison src/gtkimhtml.c @ 10457:0c020a10d5da
[gaim-migrate @ 11725]
Richard Laager writes:
This patch fixes a bug with the CSS handling in gtkimhtml
involving whitespace handling. Basically, it would accept things
like: "color: #FFFFFF" but not "color:#FFFFFF" or "color:
#FFFFFF" (more than one space). Really only the case without
spaces is of concern to me. However, I followed the coding
techniques of the rest of that section of code so it will end up
accepting multiple spaces as beneficial side effect.
When questioned as to why he needed this, he responded:
I wrote a plug-in to parse XML message histories from the official
MSN client. The styles saved in that file had no whitespace.
Initially I wrote a workaround in the plug-in, but I wanted to fix
the problem at the source.
committer: Tailor Script <tailor@pidgin.im>
author | Tim Ringenbach <marv@pidgin.im> |
---|---|
date | Thu, 30 Dec 2004 19:50:49 +0000 |
parents | 2e01c503aa4f |
children | 748aa3c6de36 |
comparison
equal
deleted
inserted
replaced
10456:d23802800eeb | 10457:0c020a10d5da |
---|---|
1849 while (*t && (*t == ' ')) t++; | 1849 while (*t && (*t == ' ')) t++; |
1850 } | 1850 } |
1851 | 1851 |
1852 if (!g_ascii_strncasecmp (t, opt, strlen (opt))) { | 1852 if (!g_ascii_strncasecmp (t, opt, strlen (opt))) { |
1853 t += strlen (opt); | 1853 t += strlen (opt); |
1854 while (*t && (*t == ' ')) t++; | |
1855 if (!*t) | |
1856 return NULL; | |
1854 } else { | 1857 } else { |
1855 return NULL; | 1858 return NULL; |
1856 } | 1859 } |
1857 | 1860 |
1858 /* if ((*t == '\"') || (*t == '\'')) { | 1861 /* if ((*t == '\"') || (*t == '\'')) { |
2381 GtkIMHtmlFontDetail *font, *oldfont = NULL; | 2384 GtkIMHtmlFontDetail *font, *oldfont = NULL; |
2382 style = gtk_imhtml_get_html_opt (tag, "style="); | 2385 style = gtk_imhtml_get_html_opt (tag, "style="); |
2383 | 2386 |
2384 if (!style) break; | 2387 if (!style) break; |
2385 | 2388 |
2386 color = gtk_imhtml_get_css_opt (style, "color: "); | 2389 color = gtk_imhtml_get_css_opt (style, "color:"); |
2387 background = gtk_imhtml_get_css_opt (style, "background: "); | 2390 background = gtk_imhtml_get_css_opt (style, "background:"); |
2388 family = gtk_imhtml_get_css_opt (style, | 2391 family = gtk_imhtml_get_css_opt (style, |
2389 "font-family: "); | 2392 "font-family:"); |
2390 size = gtk_imhtml_get_css_opt (style, "font-size: "); | 2393 size = gtk_imhtml_get_css_opt (style, "font-size:"); |
2391 textdec = gtk_imhtml_get_css_opt (style, "text-decoration: "); | 2394 textdec = gtk_imhtml_get_css_opt (style, "text-decoration:"); |
2392 | 2395 |
2393 if (!(color || family || size || background || textdec)) { | 2396 if (!(color || family || size || background || textdec)) { |
2394 g_free(style); | 2397 g_free(style); |
2395 break; | 2398 break; |
2396 } | 2399 } |