EPUB metadata: Strip pointless urn:isbn: prefix from ISBN declaration when reading metadata

This commit is contained in:
Kovid Goyal 2012-04-02 16:25:58 +05:30
parent fc6981d1d5
commit ee808594ca

View File

@ -883,6 +883,8 @@ class OPF(object): # {{{
val = etree.tostring(x, with_tail=False, encoding=unicode, val = etree.tostring(x, with_tail=False, encoding=unicode,
method='text').strip() method='text').strip()
if val and typ not in ('calibre', 'uuid'): if val and typ not in ('calibre', 'uuid'):
if typ == 'isbn' and val.lower().startswith('urn:isbn:'):
val = val[len('urn:isbn:'):]
identifiers[typ] = val identifiers[typ] = val
found_scheme = True found_scheme = True
break break