aboutsummaryrefslogtreecommitdiffstats
path: root/lib/misc.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/misc.c')
-rw-r--r--lib/misc.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/lib/misc.c b/lib/misc.c
index 9d504b75..a00f2c2f 100644
--- a/lib/misc.c
+++ b/lib/misc.c
@@ -87,6 +87,7 @@ static const htmlentity_t ent[] =
{ "lt", "<" },
{ "gt", ">" },
{ "amp", "&" },
+ { "apos", "'" },
{ "quot", "\"" },
{ "aacute", "á" },
{ "eacute", "é" },
@@ -118,6 +119,7 @@ void strip_html( char *in )
char *out = g_malloc( strlen( in ) + 1 );
char *s = out, *cs;
int i, matched;
+ int taglen;
memset( out, 0, strlen( in ) + 1 );
@@ -134,9 +136,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", 2) == 0 )
*(s++) = '\n';
in ++;
}