aboutsummaryrefslogtreecommitdiff
path: root/libsylph/html.c
diff options
context:
space:
mode:
authorhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2011-07-20 08:03:57 +0000
committerhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2011-07-20 08:03:57 +0000
commite2a169b856d1954c5cd38c4dd47cbb7a68afe41c (patch)
tree7edcda4e9455f7e6dcccecace1e2dcedfba5beb8 /libsylph/html.c
parent0a0bc26c836bfa0f82f26b8d6c9534ac058a32a7 (diff)
supported <br/> HTML tag.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@2927 ee746299-78ed-0310-b773-934348b2243d
Diffstat (limited to 'libsylph/html.c')
-rw-r--r--libsylph/html.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/libsylph/html.c b/libsylph/html.c
index 74d07c55..e61ea7cf 100644
--- a/libsylph/html.c
+++ b/libsylph/html.c
@@ -368,16 +368,20 @@ static HTMLTag *html_get_tag(const gchar *str)
if (*str == '\0' || *str == '!') return NULL;
- Xstrdup_a(tmp, str, return NULL);
+ tmp = g_strdup(str);
tag = g_new0(HTMLTag, 1);
- for (tmpp = tmp; *tmpp != '\0' && !g_ascii_isspace(*tmpp); tmpp++)
- ;
+ for (tmpp = tmp; *tmpp != '\0' && !g_ascii_isspace(*tmpp); tmpp++) {
+ if (tmpp > tmp && *tmpp == '/') {
+ *tmpp = '\0';
+ break;
+ }
+ }
if (*tmpp == '\0') {
g_strdown(tmp);
- tag->name = g_strdup(tmp);
+ tag->name = tmp;
return tag;
} else {
*tmpp++ = '\0';
@@ -393,6 +397,8 @@ static HTMLTag *html_get_tag(const gchar *str)
gchar quote;
while (g_ascii_isspace(*tmpp)) tmpp++;
+ if (tmpp > tmp && *tmpp == '/')
+ break;
attr_name = tmpp;
while (*tmpp != '\0' && !g_ascii_isspace(*tmpp) &&
@@ -414,7 +420,7 @@ static HTMLTag *html_get_tag(const gchar *str)
attr_value = tmpp;
if ((p = strchr(attr_value, quote)) == NULL) {
g_warning("html_get_tag(): syntax error in tag: '%s'\n", str);
- return tag;
+ break;
}
tmpp = p;
*tmpp++ = '\0';
@@ -437,6 +443,8 @@ static HTMLTag *html_get_tag(const gchar *str)
tag->attr = g_list_append(tag->attr, attr);
}
+ g_free(tmp);
+
return tag;
}