"Dan Harkless" <[EMAIL PROTECTED]> writes:

> Yes, the other solution is for --convert-links to simply convert the
> "hostless absolute" links (starting at the original server's
> document root) to relative links.

I was under the impression that Wget 1.7 does this.  My test seems to
confirm this:

test.html:

    <a href="/x.html">                            <!-- this one exists -->
    <a href="http://bc.arsdigita.de:1263/x.html"> <!-- likewise -->
    <a href="/y.html">                            <!-- this one doesn't -->

If I wget -rk that file from a web server, I get:

    <a href="../x.html">                            <!-- this one exists -->
    <a href="../x.html"> <!-- likewise -->
    <a href="http://bc.arsdigita.de:1263/y.html">                            <!-- this 
one doesn't -->

The first link is a "hostless absolute" one.  The second link is fully
qualified.  Both are converted to relative links because their target
was downloaded.  The third link is converted to be fully qualified
because it was not downloaded, so leaving it without a host would lead
to broken links.

> There've been some improvements to link conversion in 1.6 and the
> current beta version, 1.7-dev (see <http://sunsite.dk/wget/>), but
> unfortunately -k doesn't yet behave like my above description.
> 
> BTW, Hrvoje (if you're reading this), in revision 1.27 of TODO, you
> removed the item for converting hostless absolute links to relative.

See above.  I believe current CVS source meets the TODO requirements.
I might be missing some case, though.  These things are tricky, and a
test case would help.

Reply via email to