Free Republic
Browse · Search
General/Chat
Topics · Post Article

To: markomalley

none of the links seem to work


3 posted on 02/01/2018 6:32:21 PM PST by softwarecreator
[ Post Reply | Private Reply | To 1 | View Replies ]


To: softwarecreator

Go to the article’s source link. They are relative links, they work fine there.


9 posted on 02/01/2018 6:38:54 PM PST by FreedomPoster (Islam delenda est)
[ Post Reply | Private Reply | To 3 | View Replies ]

To: softwarecreator; markomalley
none of the links seem to work

They work on the article page. In the posted article, however, they fail because they are relative links. A relative link omits the server portion of the address. The browser assumes it is the same as that of the current page. Thus, the links fail because they are now assumed to be on the FR server. The solution is to convert the links to absolute form (server explicitly specified, not implied). E.g.,

<a href="/excellent-no-charge-books-learn-about-linux/2/">Ultimate Linux Newbie Guide</a>
should be changed to
<a href="https://www.linuxlinks.com/excellent-no-charge-books-learn-about-linux/2/">Ultimate Linux Newbie Guide</a>

Before copying HTML, I use a bookmarklet to change all the links on a page (and all the image addresses, as well) to absolute form:

javascript:var links = document.links;for (var x=0; x<links.length; ++x) links[x].href = links[x].href;var pix = document.images;for (var x=0; x<pix.length; ++x) pix[x].src = pix[x].src;void 0;

Basically, it loops over the links and images and assigns each address to itself. That has the effect of expanding relative addresses to absolute form, while leaving absolute addresses unchanged.

To use it, copy the above code to your browser's address bar, hit Enter, then bookmark the page. Name the bookmark Absolutify or whatever. Now, when you are on a page from which you would like to lift some HTML, click the bookmark first, so that the HTML you copy will contain absolute links, which will still work when you paste the HTML into FR. It's quite handy, for instance, when copying from link-happy Wikipedia entries. All the links will still work, even the footnotes.

If you are using Chrome, you probably also will want to install the View Selection Source extension.

32 posted on 02/02/2018 12:01:39 AM PST by cynwoody
[ Post Reply | Private Reply | To 3 | View Replies ]

Free Republic
Browse · Search
General/Chat
Topics · Post Article


FreeRepublic, LLC, PO BOX 9771, FRESNO, CA 93794
FreeRepublic.com is powered by software copyright 2000-2008 John Robinson