From 6ad2fdede0ae25dc0d56b5e45f6b9aa876e93b68 Mon Sep 17 00:00:00 2001 From: sje Date: Tue, 3 Jul 2007 06:26:19 +0000 Subject: don't strip links in tags get avatars! woohoo :) git-svn-id: https://server.scottellis.com.au/svn/mim_plugs@248 4f64403b-2f21-0410-a795-97e2b3489a10 --- MySpace/formatting.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'MySpace/formatting.cpp') diff --git a/MySpace/formatting.cpp b/MySpace/formatting.cpp index e66d0f6..130e703 100644 --- a/MySpace/formatting.cpp +++ b/MySpace/formatting.cpp @@ -81,9 +81,20 @@ void unentitize_nick(char *buff) { void strip_tags(char *buff) { int in = 0, out = 0; while(buff[in]) { - if(buff[in] == '<' && buff[in + 1] != 'i') { + if(buff[in] == '<' && buff[in + 1] != 'i' && buff[in + 1] != 'a') { while(buff[in] && buff[in] != '>') in++; in++; + } else if(buff[in] == '<' && buff[in + 1] == 'a') { + // link + while(buff[in] && buff[in] != '\'' && buff[in] != '\"') in++; + in++; + while(buff[in] && buff[in] != '\'' && buff[in] != '\"') + buff[out++] = buff[in++]; + while(buff[in] && buff[in] != '>') in++; + in++; + // add a space after a link in case there's something inside the tags + if(buff[in] && buff[in] != ' ' && buff[in] != '\r' && buff[in] != '\n' && buff[in] != '\t') + buff[out++] = ' '; } else buff[out++] = buff[in++]; } -- cgit v1.2.3