mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
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:
parent
6fff7a0ee5
commit
95341e93c4
@ -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):
|
||||
|
@ -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):
|
||||
|
||||
|
@ -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:
|
||||
|
Loading…
x
Reference in New Issue
Block a user