diff libgaim/util.c @ 14333:cf8d25072151

[gaim-migrate @ 17029] add font-weight support to gtkimhtml use it in our outgoing text closes sf 1083365 committer: Tailor Script <tailor@pidgin.im>
author Nathan Walp <nwalp@pidgin.im>
date Fri, 25 Aug 2006 16:42:38 +0000
parents 611ca4e7b429
children 01daacf7b771
line wrap: on
line diff
--- a/libgaim/util.c	Fri Aug 25 07:02:17 2006 +0000
+++ b/libgaim/util.c	Fri Aug 25 16:42:38 2006 +0000
@@ -1271,9 +1271,7 @@
 				}
 			} else { /* opening tag */
 				ALLOW_TAG("a");
-				ALLOW_TAG_ALT("b", "strong");
 				ALLOW_TAG("blockquote");
-				ALLOW_TAG_ALT("bold", "strong");
 				ALLOW_TAG("cite");
 				ALLOW_TAG("div");
 				ALLOW_TAG("em");
@@ -1312,6 +1310,15 @@
 						plain = g_string_append_c(plain, '\n');
 					continue;
 				}
+				if(!g_ascii_strncasecmp(c, "<b>", 3) || !g_ascii_strncasecmp(c, "<bold>", strlen("<bold>"))) {
+					struct gaim_parse_tag *pt = g_new0(struct gaim_parse_tag, 1);
+					pt->src_tag = *(c+2) == '>' ? "b" : "bold";
+					pt->dest_tag = "span";
+					tags = g_list_prepend(tags, pt);
+					c = strchr(c, '>') + 1;
+					xhtml = g_string_append(xhtml, "<span style='font-weight: bold;'>");
+					continue;
+				}
 				if(!g_ascii_strncasecmp(c, "<u>", 3) || !g_ascii_strncasecmp(c, "<underline>", strlen("<underline>"))) {
 					struct gaim_parse_tag *pt = g_new0(struct gaim_parse_tag, 1);
 					pt->src_tag = *(c+2) == '>' ? "u" : "underline";