From: Manfred Koizar Date: Mon, 18 Oct 2010 08:55:16 +0000 (+0200) Subject: Do not assume external links type to be always "text/html". X-Git-Tag: v1.13~92 X-Git-Url: http://sjero.net/git/?p=wget;a=commitdiff_plain;h=cea1f0718de13bdb1dfef956fbf74521484d4056 Do not assume external links type to be always "text/html". --- diff --git a/src/ChangeLog b/src/ChangeLog index b14620fa..93f46678 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2010-10-18 Manfred Koizar (tiny change) + + * html-url.c (tag_handle_link): Do not assume external links type + to be always "text/html". + 2010-10-16 Giuseppe Scrivano * connect.c (socket_ip_address): Initialize `sockaddr' to zero. diff --git a/src/html-url.c b/src/html-url.c index 54a0141c..0a8afc5e 100644 --- a/src/html-url.c +++ b/src/html-url.c @@ -164,6 +164,7 @@ static struct { to the attributes not mentioned here. We add them manually. */ static const char *additional_attributes[] = { "rel", /* used by tag_handle_link */ + "type", /* used by tag_handle_link */ "http-equiv", /* used by tag_handle_meta */ "name", /* used by tag_handle_meta */ "content", /* used by tag_handle_meta */ @@ -505,8 +506,8 @@ tag_handle_link (int tagid, struct taginfo *tag, struct map_context *ctx) /* All link references are external, except those known not to be, such as style sheet and shortcut icon: - - + + */ if (href) { @@ -526,11 +527,18 @@ tag_handle_link (int tagid, struct taginfo *tag, struct map_context *ctx) { up->link_inline_p = 1; } + else + { + /* The external ones usually point to HTML pages, such as + + except when the type attribute says otherwise: + + */ + char *type = find_attr (tag, "type", NULL); + if (!type || strcasecmp (type, "text/html") == 0) + up->link_expect_html = 1; + } } - else - /* The external ones usually point to HTML pages, such as - */ - up->link_expect_html = 1; } } }