Fix et al. regex for sorting by creator

\. -> \\. and apply the same escaping to general.and.
This commit is contained in:
Abe Jellinek 2022-03-15 10:05:09 -07:00
parent 26e4de500e
commit 8a235c07f1

View file

@ -1368,9 +1368,9 @@ var ItemTree = class ItemTree extends LibraryTree {
// Extract the beginning of the string in non-greedy mode
"^.+?"
// up to either the end of the string, "et al." at the end of string
+ "(?=(?: " + Zotero.getString('general.etAl').replace('.', '\.') + ")?$"
+ "(?=(?: " + Zotero.getString('general.etAl').replace('.', '\\.') + ")?$"
// or ' and '
+ "| " + Zotero.getString('general.and') + " "
+ "| " + Zotero.getString('general.and').replace('.', '\\.') + " "
+ ")"
);