Allow colons in identifier values

Fixes #1224885 [<dc:identifier opf:scheme="URI"> and semicolon #2](https://bugs.launchpad.net/calibre/+bug/1224885)
This commit is contained in:
Kovid Goyal 2013-09-14 10:16:48 +05:30
parent 6fff7a0ee5
commit 95341e93c4
3 changed files with 6 additions and 5 deletions

View File

@ -111,7 +111,7 @@ def adapt_languages(to_tuple, x):
def clean_identifier(typ, val):
typ = icu_lower(typ or '').strip().replace(':', '').replace(',', '')
val = (val or '').strip().replace(',', '|').replace(':', '|')
val = (val or '').strip().replace(',', '|')
return typ, val
def adapt_identifiers(to_tuple, x):

View File

@ -47,7 +47,7 @@ def reset_field_metadata():
field_metadata = FieldMetadata()
ck = lambda typ: icu_lower(typ).strip().replace(':', '').replace(',', '')
cv = lambda val: val.strip().replace(',', '|').replace(':', '|')
cv = lambda val: val.strip().replace(',', '|')
class Metadata(object):

View File

@ -1264,11 +1264,12 @@ class IdentifiersEdit(QLineEdit): # {{{
c = x.split(':')
if len(c) > 1:
itype = c[0].lower()
c = ':'.join(c[1:])
if itype == 'isbn':
v = check_isbn(c[1])
v = check_isbn(c)
if v is not None:
c[1] = v
ans[itype] = c[1]
c = v
ans[itype] = c
return ans
def fset(self, val):
if not val: