mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Bug #1909293:Composite tag-like column: problem with case
This commit is contained in:
parent
c071bb5be1
commit
301844ae38
@ -1306,16 +1306,9 @@ class BuiltinListUnion(BuiltinFormatterFunction):
|
|||||||
aliases = ['merge_lists']
|
aliases = ['merge_lists']
|
||||||
|
|
||||||
def evaluate(self, formatter, kwargs, mi, locals, list1, list2, separator):
|
def evaluate(self, formatter, kwargs, mi, locals, list1, list2, separator):
|
||||||
res = [l.strip() for l in list1.split(separator) if l.strip()]
|
res = {icu_lower(l.strip()): l.strip() for l in list2.split(separator) if l.strip()}
|
||||||
l2 = [l.strip() for l in list2.split(separator) if l.strip()]
|
res.update({icu_lower(l.strip()): l.strip() for l in list1.split(separator) if l.strip()})
|
||||||
lcl1 = {icu_lower(l) for l in res}
|
return separator.join(res.values())
|
||||||
|
|
||||||
for i in l2:
|
|
||||||
if icu_lower(i) not in lcl1 and i not in res:
|
|
||||||
res.append(i)
|
|
||||||
if separator == ',':
|
|
||||||
return ', '.join(res)
|
|
||||||
return separator.join(res)
|
|
||||||
|
|
||||||
|
|
||||||
class BuiltinListDifference(BuiltinFormatterFunction):
|
class BuiltinListDifference(BuiltinFormatterFunction):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user