/* unescape   and */
if (!g_ascii_strncasecmp (text, "nbsp", 4)) {
- unescaped = g_string_append_unichar (unescaped, 160);
+ g_string_append_unichar (unescaped, 160);
text += 4;
if (*text == ';') {
text++;
if (!g_ascii_strncasecmp (text, entity->escaped, escaped_len)
&& text[escaped_len] == ';') {
- unescaped = g_string_append_c (unescaped, '&');
- unescaped =
- g_string_append_len (unescaped, entity->escaped, escaped_len);
- unescaped = g_string_append_c (unescaped, ';');
+ g_string_append_c (unescaped, '&');
+ g_string_append_len (unescaped, entity->escaped, escaped_len);
+ g_string_append_c (unescaped, ';');
text += escaped_len + 1;
goto next;
}
if (!strncmp (text, entity->escaped, escaped_len)
&& text[escaped_len] == ';') {
- unescaped = g_string_append_unichar (unescaped, entity->unescaped);
+ g_string_append_unichar (unescaped, entity->unescaped);
text += escaped_len + 1;
goto next;
}
/* error occurred. pass it */
goto next;
}
- unescaped = g_string_append_unichar (unescaped, l);
+ g_string_append_unichar (unescaped, l);
text = end;
if (*text == ';') {
}
/* escape & */
- unescaped = g_string_append (unescaped, "&");
+ g_string_append (unescaped, "&");
next:
continue;
} else if (g_ascii_isspace (*text)) {
- unescaped = g_string_append_c (unescaped, ' ');
+ g_string_append_c (unescaped, ' ');
/* strip whitespace */
do {
text++;
} while ((*text) && g_ascii_isspace (*text));
} else {
- unescaped = g_string_append_c (unescaped, *text);
+ g_string_append_c (unescaped, *text);
text++;
}
}
html_context_parse (HtmlContext * ctxt, gchar * text, gsize text_len)
{
const gchar *next = NULL;
- ctxt->buf = g_string_append_len (ctxt->buf, text, text_len);
+
+ g_string_append_len (ctxt->buf, text, text_len);
next = ctxt->buf->str;
while (TRUE) {
if (next[0] == '<') {
if (context->has_result) {
if (context->rubybuf->len) {
- context->rubybuf = g_string_append_c (context->rubybuf, '\n');
+ g_string_append_c (context->rubybuf, '\n');
g_string_prepend (context->resultbuf, context->rubybuf->str);
- context->rubybuf = g_string_truncate (context->rubybuf, 0);
+ g_string_truncate (context->rubybuf, 0);
}
ret = g_string_free (context->resultbuf, FALSE);