From f40f44cc29a11b4d2db2c3dfc61998246762c192 Mon Sep 17 00:00:00 2001 From: Charles Haley Date: Thu, 5 Dec 2024 17:02:58 +0000 Subject: [PATCH] Re commit 6b98fac: for some reason the \1 must be \\1 to get the "real" text. --- src/calibre/utils/formatter_functions.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/calibre/utils/formatter_functions.py b/src/calibre/utils/formatter_functions.py index cb75d12b7a..bb78f9a255 100644 --- a/src/calibre/utils/formatter_functions.py +++ b/src/calibre/utils/formatter_functions.py @@ -1847,9 +1847,10 @@ followed by the first letter of the genre, i.e. the genre "Fiction" becomes {}''').format('''\ [CODE] program: - list_join('#@#', $authors, '&', list_re($#genre, ',', '^(.).*$', 'Genre: \1'), ',') + list_join('#@#', $authors, '&', list_re($#genre, ',', '^(.).*$', 'Genre: \\1'), ',') [/CODE] -''') # not translated as \1 gets mistranslated as a control char in transifex for some reason +''') # not translated as \1 gets mistranslated as a control char in transifex + # for some reason. And yes, the double backslash is required, for some reason. def evaluate(self, formatter, kwargs, mi, locals, with_separator, *args): if len(args) % 2 != 0: