pidgin/pidgin

Parents e9b96ef5ea38
Children f76b8bc39892
Remove purple_markup_get_css_property and purple_markup_is_rtl which are no longer used

Testing Done:
Compiled

Reviewed at https://reviews.imfreedom.org/r/1823/
--- a/ChangeLog.API Tue Sep 20 22:43:37 2022 -0500
+++ b/ChangeLog.API Wed Sep 21 03:21:41 2022 -0500
@@ -473,6 +473,8 @@
purple_ipv6_address_is_valid. Use g_hostname_is_ip_address()
or #GInetAddress instead.
* purple_markup_extract_info_field
+ * purple_markup_get_css_property
+ * purple_markup_is_rtl
* PurpleMimeDocument, PurpleMimePart,
purple_mime_document_new, purple_mime_document_free,
purple_mime_document_parse, purple_mime_document_parsen,
--- a/libpurple/purplemarkup.c Tue Sep 20 22:43:37 2022 -0500
+++ b/libpurple/purplemarkup.c Wed Sep 21 03:21:41 2022 -0500
@@ -154,100 +154,6 @@
return pln;
}
-char *
-purple_markup_get_css_property(const gchar *style,
- const gchar *opt)
-{
- const gchar *css_str = style;
- const gchar *css_value_start;
- const gchar *css_value_end;
- gchar *tmp;
- gchar *ret;
-
- g_return_val_if_fail(opt != NULL, NULL);
-
- if (!css_str)
- return NULL;
-
- /* find the CSS property */
- while (1)
- {
- /* skip whitespace characters */
- while (*css_str && g_ascii_isspace(*css_str))
- css_str++;
- if (!g_ascii_isalpha(*css_str))
- return NULL;
- if (g_ascii_strncasecmp(css_str, opt, strlen(opt)))
- {
- /* go to next css property positioned after the next ';' */
- while (*css_str && *css_str != '"' && *css_str != ';')
- css_str++;
- if(*css_str != ';')
- return NULL;
- css_str++;
- }
- else
- break;
- }
-
- /* find the CSS value position in the string */
- css_str += strlen(opt);
- while (*css_str && g_ascii_isspace(*css_str))
- css_str++;
- if (*css_str != ':')
- return NULL;
- css_str++;
- while (*css_str && g_ascii_isspace(*css_str))
- css_str++;
- if (*css_str == '\0' || *css_str == '"' || *css_str == ';')
- return NULL;
-
- /* mark the CSS value */
- css_value_start = css_str;
- while (*css_str && *css_str != '"' && *css_str != ';')
- css_str++;
- css_value_end = css_str - 1;
-
- /* Removes trailing whitespace */
- while (css_value_end > css_value_start && g_ascii_isspace(*css_value_end))
- css_value_end--;
-
- tmp = g_strndup(css_value_start, css_value_end - css_value_start + 1);
- ret = purple_unescape_html(tmp);
- g_free(tmp);
-
- return ret;
-}
-
-gboolean purple_markup_is_rtl(const char *html)
-{
- GData *attributes;
- const gchar *start, *end;
- gboolean res = FALSE;
-
- if (purple_markup_find_tag("span", html, &start, &end, &attributes))
- {
- /* tmp is a member of attributes and is free with g_datalist_clear call */
- const char *tmp = g_datalist_get_data(&attributes, "dir");
- if (tmp && !g_ascii_strcasecmp(tmp, "RTL"))
- res = TRUE;
- if (!res)
- {
- tmp = g_datalist_get_data(&attributes, "style");
- if (tmp)
- {
- char *tmp2 = purple_markup_get_css_property(tmp, "direction");
- if (tmp2 && !g_ascii_strcasecmp(tmp2, "RTL"))
- res = TRUE;
- g_free(tmp2);
- }
-
- }
- g_datalist_clear(&attributes);
- }
- return res;
-}
-
gboolean
purple_markup_find_tag(const char *needle, const char *haystack,
const char **start, const char **end, GData **attributes)
--- a/libpurple/purplemarkup.h Tue Sep 20 22:43:37 2022 -0500
+++ b/libpurple/purplemarkup.h Wed Sep 21 03:21:41 2022 -0500
@@ -191,35 +191,6 @@
*/
const char * purple_markup_unescape_entity(const char *text, int *length);
-/**
- * purple_markup_get_css_property:
- * @style: A string containing the inline CSS text.
- * @opt: The requested CSS property.
- *
- * Returns a newly allocated string containing the value of the CSS property specified
- * in opt. The @style argument is expected to point to a HTML inline CSS.
- * The function will seek for the CSS property and return its value.
- *
- * For example, purple_markup_get_css_property("direction:rtl;color:#dc4d1b;",
- * "color") would return "#dc4d1b".
- *
- * On error or if the requested property was not found, the function returns
- * %NULL.
- *
- * Returns: The value of the requested CSS property.
- */
-char * purple_markup_get_css_property(const gchar *style, const gchar *opt);
-
-/**
- * purple_markup_is_rtl:
- * @html: The HTML text.
- *
- * Check if the given HTML contains RTL text.
- *
- * Returns: TRUE if the text contains RTL text, FALSE otherwise.
- */
-gboolean purple_markup_is_rtl(const char *html);
-
G_END_DECLS
#endif /* PURPLE_MARKUP_H */