diff --git a/doc/changelog.txt b/doc/changelog.txt index 69276548..cc8f5f3c 100644 --- a/doc/changelog.txt +++ b/doc/changelog.txt @@ -10,6 +10,8 @@ Changes: by default since they require third party modules. - plugins: Print a warning for enabled plugins that could not import needed third party modules. +- checking: Treat empty URLs as same as parent URL. + Closes: GH bug #524 Fixes: - checking: Catch XML parse errors in sitemap XML files and print them diff --git a/linkcheck/checker/urlbase.py b/linkcheck/checker/urlbase.py index 850e1a83..f1a81ff1 100644 --- a/linkcheck/checker/urlbase.py +++ b/linkcheck/checker/urlbase.py @@ -315,8 +315,7 @@ class UrlBase (object): """ log.debug(LOG_CHECK, "checking syntax") if self.base_url is None: - self.set_result(_("URL is missing"), valid=False) - return + self.base_url = u"" if not (self.base_url or self.parent_url): self.set_result(_("URL is empty"), valid=False) return diff --git a/tests/checker/data/misc.html.result b/tests/checker/data/misc.html.result index 7d492661..9d77f8a6 100644 --- a/tests/checker/data/misc.html.result +++ b/tests/checker/data/misc.html.result @@ -5,10 +5,9 @@ name %(datadir)s/misc.html valid url -cache key None -real url -info The URL is outside of the domain filter, checked only syntax. -error +cache key file://%(curdir)s/%(datadir)s/misc.html +real url file://%(curdir)s/%(datadir)s/misc.html +valid url http://www.example.com/ cache key http://www.example.com/