|
18 | 18 | }, |
19 | 19 | "inRepository": true, |
20 | 20 | "translatorType": 3, |
21 | | - "lastUpdated": "2024-03-25 14:51:02" |
| 21 | + "lastUpdated": "2026-04-01 18:00:00" |
22 | 22 | } |
23 | 23 |
|
24 | 24 | /* |
@@ -1082,7 +1082,7 @@ function writeField(field, value, isMacro) { |
1082 | 1082 | value = escapeSpecialCharacters(value); |
1083 | 1083 |
|
1084 | 1084 | if (caseProtectedFields.includes(field)) { |
1085 | | - value = ZU.XRegExp.replace(value, protectCapsRE, "$1{$2$3}"); // only $2 or $3 will have a value, not both |
| 1085 | + value = value.replace(protectCapsRE, "$1{$2$3}"); // only $2 or $3 will have a value, not both |
1086 | 1086 | } |
1087 | 1087 | } |
1088 | 1088 | var exportCharset = Zotero.getOption("exportCharset"); |
@@ -1341,15 +1341,12 @@ function doExport() { |
1341 | 1341 | // Case of words with uppercase characters in non-initial positions is |
1342 | 1342 | // preserved with braces. |
1343 | 1343 | // Two extra captures because of the other regexp below |
1344 | | - protectCapsRE = new ZU.XRegExp("()()\\b([\\p{Letter}\\d]+\\p{Uppercase_Letter}[\\p{Letter}\\d]*)", 'g'); |
| 1344 | + protectCapsRE = /()()\b([\p{L}\d]+\p{Lu}[\p{L}\d]*)/gu; |
1345 | 1345 | } else { |
1346 | 1346 | // Protect all upper case letters, even if the uppercase letter is only in |
1347 | 1347 | // initial position of the word. |
1348 | 1348 | // Don't protect first word if only first letter is capitalized |
1349 | | - protectCapsRE = new ZU.XRegExp( |
1350 | | - "(.)\\b([\\p{Letter}\\d]*\\p{Uppercase_Letter}[\\p{Letter}\\d]*)" // Non-initial words with capital letter anywhere |
1351 | | - + "|^([\\p{Letter}\\d]+\\p{Uppercase_Letter}[\\p{Letter}\\d]*)" // Initial word with capital in non-initial position |
1352 | | - , 'g'); |
| 1349 | + protectCapsRE = /(.)\b([\p{L}\d]*\p{Lu}[\p{L}\d]*)|^([\p{L}\d]+\p{Lu}[\p{L}\d]*)/gu; |
1353 | 1350 | } |
1354 | 1351 |
|
1355 | 1352 | //Zotero.write("% BibTeX export generated by Zotero "+Zotero.Utilities.getVersion()); |
|
0 commit comments