Hi,
I'm using a custom column to work with the Kindle Collections plugin. It collects author names in three groups ("A-I", "J-Q" and "S-Z"). A fourth ("other") is reserved for authors who might call themselves something like 123foo or $bar.
The following code worked fine so far...
Code:
program:
author_first_letter = substr(field('author_sort'), 0, 1);
group = switch(author_first_letter,
'[A-I]', 'A-I',
'[J-R]', 'J-R',
'[S-Z]', 'S-Z',
'other');
strcat('Authors ', group)
...until Karel Čapek came along.
His books should be found in the "A-I" collection but are listed under "other". So I expanded the regular expression to
That works fine in the
Edit template window, the calculated
Template value is "Authors A-I".
But the colums and tag browser show it under "other".
I also tried unicode:
but it's still an incorrect result.
Being both 1) new to the calibre template language and 2) a regular-expression-avoider-whenever-I-can I assume that I made a mistake... but what puzzles me is that the
Template value of the
Edit template window shows the expected "Authors A-I" (at least in the first case, without unicode notation).
Could this be a bug in Calibre?