mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-06-23 15:30:45 -04:00
prevent list_re from adding empty items to the set. Permit the replacement to create list items (add commas).
This commit is contained in:
parent
9a0ca74813
commit
809ea8c1a7
@ -1010,7 +1010,8 @@ class BuiltinListRe(BuiltinFormatterFunction):
|
||||
if re.search(search_re, item, flags=re.I) is not None:
|
||||
if opt_replace:
|
||||
item = re.sub(search_re, opt_replace, item)
|
||||
res.add(item)
|
||||
for i in [l.strip() for l in item.split(',') if l.strip()]:
|
||||
res.add(i)
|
||||
if separator == ',':
|
||||
return ', '.join(res)
|
||||
return separator.join(res)
|
||||
|
Loading…
x
Reference in New Issue
Block a user