im.pidgin.pidgin: 4b11e0842d46778d47f4901ed6e00169c970471d

markdoliner at pidgin.im markdoliner at pidgin.im
Thu Jan 24 00:30:48 EST 2008


-----------------------------------------------------------------
Revision: 4b11e0842d46778d47f4901ed6e00169c970471d
Ancestor: 18ef4f37bd517422108a825df6d78ba063ef7c81
Author: markdoliner at pidgin.im
Date: 2008-01-24T05:24:20
Branch: im.pidgin.pidgin

Modified files:
        libpurple/util.c

ChangeLog: 

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.

-------------- next part --------------
============================================================
--- libpurple/util.c	6a420aa1b7199b68194c51aec37e4ee9e3fde96e
+++ libpurple/util.c	1b362c0534b084dde914314ee50a1e392bd3e763
@@ -1445,7 +1445,6 @@ purple_markup_html_to_xhtml(const char *
 				ALLOW_TAG("pre");
 				ALLOW_TAG("q");
 				ALLOW_TAG("span");
-				ALLOW_TAG("strong");
 				ALLOW_TAG("ul");
 
 
@@ -1465,9 +1464,14 @@ purple_markup_html_to_xhtml(const char *
 						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;


More information about the Commits mailing list