diff --git a/linkcheck/url.py b/linkcheck/url.py index 5755cab2..0191d94e 100644 --- a/linkcheck/url.py +++ b/linkcheck/url.py @@ -316,7 +316,8 @@ def match_host (host, domainlist): return False -_safe_url_chars = re.compile(r"^[-a-zA-Z0-9_:/\.,~;=&#%()@\?]*$") +_safe_url_chars = r"-a-zA-Z0-9_:/\.,~;=&#%()@\?\|" +_safe_url_chars_ro = re.compile(r"^[%s]*$" % _safe_url_chars) def url_needs_quoting (url): """Check if url needs percent quoting. Note that the method does only check basic character sets, and not any other syntax. @@ -327,7 +328,7 @@ def url_needs_quoting (url): # handle trailing whitespace as a special case # since '$' matches immediately before a end-of-line return True - return not _safe_url_chars.match(url) + return not _safe_url_chars_ro.match(url) def spliturl (url):