# HG changeset patch # User Nathan Walp # Date 1064981251 0 # Node ID 8130adad8b7a5961ab78dcb2be2a52f88845b72c # Parent 770233dad86c6644303a6e1d5bd05e69e063a9d0 [gaim-migrate @ 7664] this is cleaner, and does a better job of stripping html committer: Tailor Script diff -r 770233dad86c -r 8130adad8b7a src/util.c --- a/src/util.c Wed Oct 01 04:05:46 2003 +0000 +++ b/src/util.c Wed Oct 01 04:07:31 2003 +0000 @@ -1553,62 +1553,11 @@ char * gaim_markup_strip_html(const char *str) { - int i, j, k; - gboolean visible = TRUE; - gchar *str2; - - g_return_val_if_fail(str != NULL, NULL); - - str2 = g_strdup(str); - - for (i = 0, j = 0; str2[i]; i++) - { - if (str2[i] == '<') - { - k = i + 1; - - if(g_ascii_isspace(str2[k])) - visible = TRUE; - else - { - while (str2[k]) - { - if (str2[k] == '<') - { - visible = TRUE; - break; - } + char *ret; - if (str2[k] == '>') - { - visible = FALSE; - break; - } + gaim_markup_html_to_xhtml(str, NULL, &ret); - k++; - } - } - } - else if (str2[i] == '>' && !visible) - { - visible = TRUE; - continue; - } - - if (str2[i] == '&' && strncasecmp(str2 + i, """, 6) == 0) - { - str2[j++] = '\"'; - i = i + 5; - continue; - } - - if (visible) - str2[j++] = str2[i]; - } - - str2[j] = '\0'; - - return str2; + return ret; } gboolean