]> sjero.net Git - wget/commitdiff
Do not assume external links type to be always "text/html".
authorManfred Koizar <mkoi-pg@aon.at>
Mon, 18 Oct 2010 08:55:16 +0000 (10:55 +0200)
committerGiuseppe Scrivano <gscrivano@gnu.org>
Mon, 18 Oct 2010 08:55:16 +0000 (10:55 +0200)
src/ChangeLog
src/html-url.c

index b14620fa42c994349ffc8ea6919fe55c01076c0f..93f466782d812b657ef9e20f5eb821405d704339 100644 (file)
@@ -1,3 +1,8 @@
+2010-10-18  Manfred Koizar <mkoi-pg@aon.at> (tiny change)
+
+       * html-url.c (tag_handle_link): Do not assume external links type
+       to be always "text/html".
+
 2010-10-16  Giuseppe Scrivano  <gscrivano@gnu.org>
 
        * connect.c (socket_ip_address): Initialize `sockaddr' to zero.
 2010-10-16  Giuseppe Scrivano  <gscrivano@gnu.org>
 
        * connect.c (socket_ip_address): Initialize `sockaddr' to zero.
index 54a0141c4533672c1c8c5de70d60acb6c6fa8d61..0a8afc5ef4fb3510877ff8ad7bced52133e18c00 100644 (file)
@@ -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  */
    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  */
   "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 href="..."> link references are external, except those
      known not to be, such as style sheet and shortcut icon:
 
   /* All <link href="..."> link references are external, except those
      known not to be, such as style sheet and shortcut icon:
 
-       <link rel="stylesheet" href="...">
-       <link rel="shortcut icon" href="...">
+     <link rel="stylesheet" href="...">
+     <link rel="shortcut icon" href="...">
   */
   if (href)
     {
   */
   if (href)
     {
@@ -526,11 +527,18 @@ tag_handle_link (int tagid, struct taginfo *tag, struct map_context *ctx)
                 {
                   up->link_inline_p = 1;
                 }
                 {
                   up->link_inline_p = 1;
                 }
+              else
+                {
+                  /* The external ones usually point to HTML pages, such as
+                     <link rel="next" href="...">
+                     except when the type attribute says otherwise:
+                     <link rel="alternate" type="application/rss+xml" href=".../?feed=rss2" />
+                  */
+                  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
-               <link rel="next" href="..."> */
-            up->link_expect_html = 1;
         }
     }
 }
         }
     }
 }