changeset 8534:389e2b9dae6a

[gaim-migrate @ 9273] this should get rid of the </FONT> on the ends of lines from AIM users in logs committer: Tailor Script <tailor@pidgin.im>
author Nathan Walp <nwalp@pidgin.im>
date Wed, 31 Mar 2004 05:53:48 +0000
parents ef3d81aa663a
children 7b0df53a409d
files src/util.c
diffstat 1 files changed, 13 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/util.c	Wed Mar 31 03:10:37 2004 +0000
+++ b/src/util.c	Wed Mar 31 05:53:48 2004 +0000
@@ -758,11 +758,19 @@
 					g_free(tag->data);
 					tags = g_list_remove(tags, tag->data);
 				} else {
-					/* we tried to close a tag we never opened! escape it
-					 * and move on */
-					xhtml = g_string_append(xhtml, "&lt;");
-					plain = g_string_append_c(plain, '<');
-					c++;
+					/* a closing tag we weren't expecting...
+					 * we'll let it slide, if it's really a tag...if it's
+					 * just a </ we'll escape it properly */
+					const char *end = c+2;
+					while(*end && g_ascii_isalpha(*end))
+						end++;
+					if(*end == '>') {
+						c = end+1;
+					} else {
+						xhtml = g_string_append(xhtml, "&lt;");
+						plain = g_string_append_c(plain, '<');
+						c++;
+					}
 				}
 			} else { /* opening tag */
 				ALLOW_TAG("a");