changeset 22191:3634d27ec6f1

Change purple_markup_html_to_xhtml() to convert <strong> tags to <span style="font-weight: bold;">, as the latter is what is used in XEP-0071 http://www.xmpp.org/extensions/xep-0071.html#examples We use this function in two other places outside of Jabber: libpurple/log.c and pidgin/plugins/gtkbuddynote.c. I don't think this change will negatively affect either of them, because the generated xhtml will only be viewed by Pidgin, and Pidgin understands the span tag. Thanks to Thomas Bohn for emailing meebo about this.
author Mark Doliner <mark@kingant.net>
date Thu, 24 Jan 2008 05:24:20 +0000
parents bcaf4a037704
children 17e21fa1db57
files libpurple/util.c
diffstat 1 files changed, 7 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/util.c	Wed Jan 23 21:46:54 2008 +0000
+++ b/libpurple/util.c	Thu Jan 24 05:24:20 2008 +0000
@@ -1445,7 +1445,6 @@
 				ALLOW_TAG("pre");
 				ALLOW_TAG("q");
 				ALLOW_TAG("span");
-				ALLOW_TAG("strong");
 				ALLOW_TAG("ul");
 
 
@@ -1465,9 +1464,14 @@
 						plain = g_string_append_c(plain, '\n');
 					continue;
 				}
-				if(!g_ascii_strncasecmp(c, "<b>", 3) || !g_ascii_strncasecmp(c, "<bold>", strlen("<bold>"))) {
+				if(!g_ascii_strncasecmp(c, "<b>", 3) || !g_ascii_strncasecmp(c, "<bold>", strlen("<bold>")) || !g_ascii_strncasecmp(c, "<strong>", strlen("<strong>"))) {
 					struct purple_parse_tag *pt = g_new0(struct purple_parse_tag, 1);
-					pt->src_tag = *(c+2) == '>' ? "b" : "bold";
+					if (*(c+2) == '>')
+						pt->src_tag = "b";
+					else if (*(c+2) == 'o')
+						pt->src_tag = "bold";
+					else
+						pt->src_tag = "strong";
 					pt->dest_tag = "span";
 					tags = g_list_prepend(tags, pt);
 					c = strchr(c, '>') + 1;