linkinator icon indicating copy to clipboard operation
linkinator copied to clipboard

Excluding external URLs

Open danieleds opened this issue 2 years ago • 2 comments

Hello,

is there a way to skip external URLs? Filtering with a regex such as ^(https?://) doesn't work, since it will match all URLs (see #382 for more information)

I'm running linkinator on the local file system, and I'd like to skip all external links, and explicit links to localhost too.

danieleds avatar Oct 04 '22 14:10 danieleds

have you tried?

--include, -i
        List of urls in regexy form to include.  The opposite of --skip.

sebawita avatar Dec 15 '22 16:12 sebawita

Couldn't try it, but I assume the behavior will be the same (just negated) so it won't solve the issue.

Per https://github.com/JustinBeckwith/linkinator/issues/382#issuecomment-1120352377:

Heh, so this is a kind of funny problem. Linkinator works by mounting the local folder you're scanning as a static HTTP server, so most likely all links are getting picked up by this regex.

danieleds avatar Dec 15 '22 17:12 danieleds