mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-31 14:33:54 -04:00
allow empty suffixes
This commit is contained in:
parent
3bc9f1c4f4
commit
86e4a79f32
@ -3512,10 +3512,12 @@ This can be useful to truncate a value.
|
||||
|
||||
def repl(mo):
|
||||
fmt_char = mo.group(1)
|
||||
suffixes = re.split(r'\|', mo.group(3) or '')
|
||||
match len(suffixes):
|
||||
case 1 if not suffixes[0]:
|
||||
suffixes = mo.group(3)
|
||||
if suffixes is None:
|
||||
zero_suffix = one_suffix = more_suffix = fmt_char.lower() + ' '
|
||||
else:
|
||||
suffixes = re.split(r'\|', suffixes)
|
||||
match len(suffixes):
|
||||
case 1:
|
||||
zero_suffix = one_suffix = more_suffix = suffixes[0]
|
||||
case 2:
|
||||
|
Loading…
x
Reference in New Issue
Block a user