diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | libsylph/html.c | 21 |
2 files changed, 18 insertions, 8 deletions
@@ -1,3 +1,8 @@ +2010-12-17 + + * libsylph/html.c: html_parse_tag(): look at every attribute in 'a' + tag for 'href' (thanks to Rich Coe). + 2010-12-15 * src/summaryview.c: summary_toggle_view(): mark as read when message 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); |