Remove purple_markup_escape_text
This was originally added because g_markup_escape_text turns ' in to '
which isn't an element in HTML 4 and apparently it wasn't rendered right in
IE7. Those days are long gone, so there's no reason we need this anymore.
Testing Done:
Compiled and ran the unit tests
Reviewed at https://reviews.imfreedom.org/r/2096/
--- a/ChangeLog.API Fri Nov 25 23:39:13 2022 -0600
+++ b/ChangeLog.API Fri Nov 25 23:40:58 2022 -0600
@@ -510,6 +510,7 @@
* purple_ip_address_is_valid, purple_ipv4_address_is_valid, and
purple_ipv6_address_is_valid. Use g_hostname_is_ip_address()
or #GInetAddress instead.
+ * purple_markup_escape_text * purple_markup_extract_info_field
* purple_markup_get_css_property
--- a/finch/gntconv.c Fri Nov 25 23:39:13 2022 -0600
+++ b/finch/gntconv.c Fri Nov 25 23:40:58 2022 -0600
@@ -154,7 +154,7 @@
- char *escape = purple_markup_escape_text((*text == '/' ? text + 1 : text), -1);
+ char *escape = g_markup_escape_text((*text == '/' ? text + 1 : text), -1); purple_conversation_send(ggconv->active_conv, escape);
--- a/libpurple/protocols/facebook/facebook.c Fri Nov 25 23:39:13 2022 -0600
+++ b/libpurple/protocols/facebook/facebook.c Fri Nov 25 23:40:58 2022 -0600
@@ -555,7 +555,7 @@
- html = purple_markup_escape_text(msg->text, -1);
+ html = g_markup_escape_text(msg->text, -1); --- a/libpurple/protocols/jabber/buddy.c Fri Nov 25 23:39:13 2022 -0600
+++ b/libpurple/protocols/jabber/buddy.c Fri Nov 25 23:40:58 2022 -0600
@@ -773,7 +773,7 @@
const char *status_name = jabber_buddy_state_get_name(jbr->state);
- tmp = purple_markup_escape_text(jbr->status, -1);
+ tmp = g_markup_escape_text(jbr->status, -1); purdy = purple_strdup_withhtml(tmp);
--- a/libpurple/protocols/jabber/message.c Fri Nov 25 23:39:13 2022 -0600
+++ b/libpurple/protocols/jabber/message.c Fri Nov 25 23:40:58 2022 -0600
@@ -553,7 +553,7 @@
} else if(purple_strequal(child->name, "body") && purple_strequal(xmlns, NS_XMPP_CLIENT)) {
char *msg = purple_xmlnode_get_data(child);
- char *escaped = purple_markup_escape_text(msg, -1);
+ char *escaped = g_markup_escape_text(msg, -1); jm->body = purple_strdup_withhtml(escaped);
--- a/libpurple/purplemarkup.c Fri Nov 25 23:39:13 2022 -0600
+++ b/libpurple/purplemarkup.c Fri Nov 25 23:40:58 2022 -0600
@@ -24,77 +24,6 @@
- * This function is stolen from glib's gmarkup.c and modified to not
- * replace ' with '
-static void append_escaped_text(GString *str,
- const gchar *text, gssize length)
- next = g_utf8_next_char (p);
- g_string_append (str, "&");
- g_string_append (str, "<");
- g_string_append (str, ">");
- g_string_append (str, """);
- c = g_utf8_get_char (p);
- if ((0x1 <= c && c <= 0x8) ||
- (0xb <= c && c <= 0xc) ||
- (0xe <= c && c <= 0x1f) ||
- (0x7f <= c && c <= 0x84) ||
- (0x86 <= c && c <= 0x9f))
- g_string_append_printf (str, "&#x%x;", c);
- g_string_append_len (str, p, next - p);
-/* This function is stolen from glib's gmarkup.c */
-gchar *purple_markup_escape_text(const gchar *text, gssize length)
- g_return_val_if_fail(text != NULL, NULL);
- /* prealloc at least as long as original text */
- str = g_string_sized_new(length);
- append_escaped_text(str, text, length);
- return g_string_free(str, FALSE);
purple_markup_unescape_entity(const char *text, int *length)
--- a/libpurple/purplemarkup.h Fri Nov 25 23:39:13 2022 -0600
+++ b/libpurple/purplemarkup.h Fri Nov 25 23:40:58 2022 -0600
@@ -32,21 +32,6 @@
- * purple_markup_escape_text:
- * @text: The text to escape
- * @length: The length of the text, or -1 if #NULL terminated
- * Escapes special characters in a plain-text string so they display
- * correctly as HTML. For example, & is replaced with &amp; and < is
- * replaced with &lt;
- * This is exactly the same as g_markup_escape_text(), except that it
- * does not change ' to &apos; because &apos; is not a valid HTML 4 entity,
- * and is displayed literally in IE7.
-gchar *purple_markup_escape_text(const gchar *text, gssize length);
* purple_markup_html_to_xhtml:
* @html: The HTML markup.
* @dest_xhtml: The destination XHTML output.