Fix regression that broke url:http|... style identifiers

This commit is contained in:
Kovid Goyal 2016-04-28 15:21:34 +05:30
parent 1a5b295c82
commit 2fe618b4c1

View File

@ -567,8 +567,9 @@ def urls_from_identifiers(identifiers): # {{{
ans.append((issn, 'issn', issn,
'http://www.worldcat.org/issn/'+issn))
for k, url in identifiers.iteritems():
if url and re.match(r'ur[il]\d*$', k) is not None and url.partition(':')[0].lower() in {'http', 'file', 'https'}:
if url and re.match(r'ur[il]\d*$', k) is not None:
url = url[:8].replace('|', ':') + url[8:].replace('|', ',')
if url.partition(':')[0].lower() in {'http', 'file', 'https'}:
parts = urlparse(url)
name = parts.netloc or parts.path
ans.append((name, k, url, url))