diff options
author | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2010-12-17 04:42:56 +0000 |
---|---|---|
committer | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2010-12-17 04:42:56 +0000 |
commit | 81e19dc4e8de47803795fcffe177f410c50a4e3f (patch) | |
tree | 2f42940f9085458b76bf2d2826224e69931813f1 /libsylph | |
parent | 43b9c44f81953f695eb4dfd804cff3ae2dfbe306 (diff) |
look at every attribute in 'a' tag for 'href' (thanks to Rich Coe).
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@2756 ee746299-78ed-0310-b773-934348b2243d
Diffstat (limited to 'libsylph')
-rw-r--r-- | libsylph/html.c | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/libsylph/html.c b/libsylph/html.c index 94da46df..74d07c55 100644 --- a/libsylph/html.c +++ b/libsylph/html.c @@ -1,6 +1,6 @@ /* * LibSylph -- E-Mail client library - * Copyright (C) 1999-2005 Hiroyuki Yamamoto + * Copyright (C) 1999-2010 Hiroyuki Yamamoto * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -472,12 +472,17 @@ static HTMLState html_parse_tag(HTMLParser *parser) html_append_char(parser, '\n'); parser->state = HTML_BR; } else if (!strcmp(tag->name, "a")) { - if (tag->attr && tag->attr->data && - !strcmp(((HTMLAttr *)tag->attr->data)->name, "href")) { - g_free(parser->href); - parser->href = - g_strdup(((HTMLAttr *)tag->attr->data)->value); - parser->state = HTML_HREF; + GList *cur; + + for (cur = tag->attr; cur != NULL; cur = cur->next) { + HTMLAttr *attr = (HTMLAttr *)cur->data; + + if (attr && !strcmp(attr->name, "href")) { + g_free(parser->href); + parser->href = g_strdup(attr->value); + parser->state = HTML_HREF; + break; + } } } else if (!strcmp(tag->name, "/a")) { g_free(parser->href); @@ -533,7 +538,7 @@ static HTMLState html_parse_tag(HTMLParser *parser) html_append_char(parser, '\n'); } parser->state = HTML_NORMAL; - } + } html_free_tag(tag); |