aboutsummaryrefslogtreecommitdiffstats
path: root/lib/misc.c
diff options
context:
space:
mode:
authorWilmer van der Gaast <wilmer@gaast.net>2010-08-24 00:12:24 +0100
committerWilmer van der Gaast <wilmer@gaast.net>2010-08-24 00:12:24 +0100
commitbe999a5385ff4e9ac7416de4cca3288f18cee85c (patch)
treeddd6a6e256719c378e9748e0d96791e11844f659 /lib/misc.c
parent237eadd361a7ed1d2a49180056d12b57f6f3cc0a (diff)
parenteb6df6a280c458546ebc57126e63a828674b4cd8 (diff)
First step in this merge. Mostly a bzr merge and then a cleanup of conflicts
and parts I want to/have to redo (because of ui-fix).
Diffstat (limited to 'lib/misc.c')
-rw-r--r--lib/misc.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/misc.c b/lib/misc.c
index b696b8c4..c37996fc 100644
--- a/lib/misc.c
+++ b/lib/misc.c
@@ -156,6 +156,7 @@ void strip_html( char *in )
char out[strlen(in)+1];
char *s = out, *cs;
int i, matched;
+ int taglen;
memset( out, 0, sizeof( out ) );
@@ -172,9 +173,18 @@ void strip_html( char *in )
while( *in && *in != '>' )
in ++;
+ taglen = in - cs - 1; /* not <0 because the above loop runs at least once */
if( *in )
{
- if( g_strncasecmp( cs+1, "br", 2) == 0 )
+ if( g_strncasecmp( cs+1, "b", taglen) == 0 )
+ *(s++) = '\x02';
+ else if( g_strncasecmp( cs+1, "/b", taglen) == 0 )
+ *(s++) = '\x02';
+ else if( g_strncasecmp( cs+1, "i", taglen) == 0 )
+ *(s++) = '\x1f';
+ else if( g_strncasecmp( cs+1, "/i", taglen) == 0 )
+ *(s++) = '\x1f';
+ else if( g_strncasecmp( cs+1, "br", taglen) == 0 )
*(s++) = '\n';
in ++;
}