]> sjero.net Git - wget/blobdiff - doc/wget.texi
[svn] Introduce non-strict comment parsing.
[wget] / doc / wget.texi
index d23661eb9a0b82c8a2773c1a6e8fd037a07c2e4d..78bc20dca3ac3055b03f63453bd22aded4cc5012 100644 (file)
@@ -512,7 +512,9 @@ IPs.
 @item -t @var{number}
 @itemx --tries=@var{number}
 Set number of retries to @var{number}.  Specify 0 or @samp{inf} for
-infinite retrying.
+infinite retrying.  The default is to retry 20 times, with the exception
+of fatal errors like ``connection refused'' or ``not found'' (404),
+which are not retried.
 
 @item -O @var{file}
 @itemx --output-document=@var{file}
@@ -740,7 +742,7 @@ Note that this option is turned on by default in the global
 
 @cindex wait, random
 @cindex random wait
-@itemx --random-wait
+@item --random-wait
 Some web sites may perform log analysis to identify retrieval programs
 such as Wget by looking for statistically significant similarities in
 the time between requests. This option causes the time between requests
@@ -785,7 +787,7 @@ Setting quota to 0 or to @samp{inf} unlimits the download quota.
 
 @cindex DNS cache
 @cindex caching of DNS lookups
-@itemx --dns-cache=off
+@item --dns-cache=off
 Turn off caching of DNS lookups.  Normally, Wget remembers the addresses
 it looked up from DNS so it doesn't have to repeatedly contact the DNS
 server for the same (typically small) set of addresses it retrieves
@@ -808,36 +810,39 @@ this option.
 
 @cindex file names, restrict
 @cindex Windows file names
-@itemx --restrict-file-names=none|unix|windows
-Restrict characters that may occur in local file names created by Wget
-from remote URLs.  Characters that are considered @dfn{unsafe} under a
-set of restrictions are escaped, i.e. replaced with @samp{%XX}, where
-@samp{XX} is the hexadecimal code of the character.
-
-The default for this option depends on the operating system: on Unix and
-Unix-like OS'es, it defaults to ``unix''.  Under Windows and Cygwin, it
-defaults to ``windows''.  Changing the default is useful when you are
-using a non-native partition, e.g. when downloading files to a Windows
-partition mounted from Linux, or when using NFS-mounted or SMB-mounted
-Windows drives.
-
-When set to ``none'', the only characters that are quoted are those that
-are impossible to get into a file name---the NUL character and @samp{/}.
-The control characters, newline, etc. are all placed into file names.
-
-When set to ``unix'', additional unsafe characters are those in the
-0--31 range and in the 128--159 range.  This is because those characters
-are typically not printable.
-
-When set to ``windows'', all of the above are quoted, along with
-@samp{\}, @samp{|}, @samp{:}, @samp{?}, @samp{"}, @samp{*}, @samp{<},
-and @samp{>}.  Additionally, Wget in Windows mode uses @samp{+} instead
-of @samp{:} to separate host and port in local file names, and uses
+@item --restrict-file-names=@var{mode}
+Change which characters found in remote URLs may show up in local file
+names generated from those URLs.  Characters that are @dfn{restricted}
+by this option are escaped, i.e. replaced with @samp{%HH}, where
+@samp{HH} is the hexadecimal number that corresponds to the restricted
+character.
+
+By default, Wget escapes the characters that are not valid as part of
+file names on your operating system, as well as control characters that
+are typically unprintable.  This option is useful for changing these
+defaults, either because you are downloading to a non-native partition,
+or because you want to disable escaping of the control characters.
+
+When mode is set to ``unix'', Wget escapes the character @samp{/} and
+the control characters in the ranges 0--31 and 128--159.  This is the
+default on Unix-like OS'es.
+
+When mode is seto to ``windows'', Wget escapes the characters @samp{\},
+@samp{|}, @samp{/}, @samp{:}, @samp{?}, @samp{"}, @samp{*}, @samp{<},
+@samp{>}, and the control characters in the ranges 0--31 and 128--159.
+In addition to this, Wget in Windows mode uses @samp{+} instead of
+@samp{:} to separate host and port in local file names, and uses
 @samp{@@} instead of @samp{?} to separate the query portion of the file
 name from the rest.  Therefore, a URL that would be saved as
 @samp{www.xemacs.org:4300/search.pl?input=blah} in Unix mode would be
 saved as @samp{www.xemacs.org+4300/search.pl@@input=blah} in Windows
-mode.
+mode.  This mode is the default on Windows.
+
+If you append @samp{,nocontrol} to the mode, as in
+@samp{unix,nocontrol}, escaping of the control characters is also
+switched off.  You can use @samp{--restrict-file-names=nocontrol} to
+turn off escaping of control characters without affecting the choice of
+the OS to use as file name restriction mode.
 @end table
 
 @node Directory Options, HTTP Options, Download Options, Invoking
@@ -1360,6 +1365,40 @@ To finish off this topic, it's worth knowing that Wget's idea of an
 external document link is any URL specified in an @code{<A>} tag, an
 @code{<AREA>} tag, or a @code{<LINK>} tag other than @code{<LINK
 REL="stylesheet">}.
+
+@cindex HTML comments
+@cindex comments, HTML
+@item --strict-comments
+Turn on strict parsing of HTML comments.  The default is to terminate
+comments at the first occurrence of @samp{-->}.
+
+According to specifications, HTML comments are expressed as SGML
+@dfn{declarations}.  Declaration is special markup that begins with
+@samp{<!} and ends with @samp{>}, such as @samp{<!DOCTYPE ...>}, that
+may contain comments between a pair of @samp{--} delimiters.  HTML
+comments are ``empty declarations'', SGML declarations without any
+non-comment text.  Therefore, @samp{<!--foo-->} is a valid comment, and
+so is @samp{<!--one-- --two-->}, but @samp{<!--1--2-->} is not.
+
+On the other hand, most HTML writers don't perceive comments as anything
+other than text delimited with @samp{<!--} and @samp{-->}, which is not
+quite the same.  For example, something like @samp{<!------------>}
+works as a valid comment as long as the number of dashes is a multiple
+of four (!).  If not, the comment technically lasts until the next
+@samp{--}, which may be at the other end of the document.  Because of
+this, many popular browsers completely ignore the specification and
+implement what users have come to expect: comments delimited with
+@samp{<!--} and @samp{-->}.
+
+Until version 1.9, Wget interpreted comments strictly, which resulted in
+missing links in many web pages that displayed fine in browsers, but had
+the misfortune of containing non-compliant comments.  Beginning with
+version 1.9, Wget has joined the ranks of clients that implements
+``naive'' comments, terminating each comment at the first occurrence of
+@samp{-->}.
+
+If, for whatever reason, you want strict comment parsing, use this
+option to turn it on.
 @end table
 
 @node Recursive Accept/Reject Options,  , Recursive Retrieval Options, Invoking
@@ -2279,7 +2318,7 @@ Links}).
 If set to on, remove @sc{ftp} listings downloaded by Wget.  Setting it
 to off is the same as @samp{-nr}.
 
-@item restrict_file_names = off/unix/windows
+@item restrict_file_names = unix/windows
 Restrict the file names generated by Wget from URLs.  See
 @samp{--restrict-file-names} for a more detailed description.
 
@@ -2301,6 +2340,9 @@ responses---the same as @samp{-S}.
 @item span_hosts = on/off
 Same as @samp{-H}.
 
+@item strict_comments = on/off
+Same as @samp{--strict-comments}.
+
 @item timeout = @var{n}
 Set timeout value---the same as @samp{-T}.