Mercurial > pidgin.yaz
changeset 7099:8130adad8b7a
[gaim-migrate @ 7664]
this is cleaner, and does a better job of stripping html
committer: Tailor Script <tailor@pidgin.im>
author | Nathan Walp <nwalp@pidgin.im> |
---|---|
date | Wed, 01 Oct 2003 04:07:31 +0000 |
parents | 770233dad86c |
children | abdc55ffadba |
files | src/util.c |
diffstat | 1 files changed, 3 insertions(+), 54 deletions(-) [+] |
line wrap: on
line diff
--- 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