mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-04-30 19:23:01 +02:00
Fix the subitems formatter function to split only when the period is surrounded by non-white space and not another period
This commit is contained in:
parent
ad23762ae6
commit
428313d1ea
1 changed files with 3 additions and 3 deletions
|
|
@ -720,12 +720,12 @@ def evaluate(self, formatter, kwargs, mi, locals, val, start_index, end_index):
|
|||
items = [v.strip() for v in val.split(',')]
|
||||
rv = set()
|
||||
for item in items:
|
||||
component = item.split('.')
|
||||
components = re.split(r'(?<=[^\.\s])\.(?=[^\.\s])', item, flags=re.U)
|
||||
try:
|
||||
if ei == 0:
|
||||
rv.add('.'.join(component[si:]))
|
||||
rv.add('.'.join(components[si:]))
|
||||
else:
|
||||
rv.add('.'.join(component[si:ei]))
|
||||
rv.add('.'.join(components[si:ei]))
|
||||
except:
|
||||
pass
|
||||
return ', '.join(sorted(rv, key=sort_key))
|
||||
|
|
|
|||
Loading…
Reference in a new issue