mirror of
https://github.com/kovidgoyal/calibre.git
synced 2026-03-16 22:49:17 -04: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
@ -720,12 +720,12 @@ class BuiltinSubitems(BuiltinFormatterFunction):
|
||||
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…
x
Reference in New Issue
Block a user