mirror of
git://github.com/kovidgoyal/calibre.git
synced 2025-12-23 06:05:35 +01: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
1 changed files with 2 additions and 1 deletions
|
|
@ -1010,7 +1010,8 @@ def evaluate(self, formatter, kwargs, mi, locals, src_list, separator, search_re
|
|||
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…
Reference in a new issue