|
18 | 18 | "inRepository": true,
|
19 | 19 | "translatorType": 3,
|
20 | 20 | "browserSupport": "gcsv",
|
21 |
| - "lastUpdated": "2015-02-12 07:13:30" |
| 21 | + "lastUpdated": "2015-02-16 03:35:30" |
22 | 22 | }
|
23 | 23 |
|
24 | 24 | function detectImport() {
|
@@ -902,7 +902,7 @@ function writeField(field, value, isMacro) {
|
902 | 902 | value = value.replace(/[|\<\>\~\^\\\{\}]/g, mapEscape).replace(/([\#\$\%\&\_])/g, "\\$1");
|
903 | 903 |
|
904 | 904 | if (caseProtectedFields.indexOf(field) != -1) {
|
905 |
| - value = ZU.XRegExp.replace(value, protectCapsRE, "$1{$2}"); |
| 905 | + value = ZU.XRegExp.replace(value, protectCapsRE, "$1{$2$3}"); // only $2 or $3 will have a value, not both |
906 | 906 | }
|
907 | 907 | }
|
908 | 908 | if (Zotero.getOption("exportCharset") != "UTF-8") {
|
@@ -1109,15 +1109,15 @@ function doExport() {
|
1109 | 1109 | if (Zotero.getHiddenPref && Zotero.getHiddenPref('BibTeX.export.dontProtectInitialCase')) {
|
1110 | 1110 | // Case of words with uppercase characters in non-initial positions is
|
1111 | 1111 | // preserved with braces.
|
1112 |
| - // Two captures because of the other regexp below |
1113 |
| - protectCapsRE = new ZU.XRegExp("()\\b(\\p{Letter}+\\p{Uppercase_Letter}\\p{Letter}*)", 'g'); |
| 1112 | + // Two extra captures because of the other regexp below |
| 1113 | + protectCapsRE = new ZU.XRegExp("()()\\b(\\p{Letter}+\\p{Uppercase_Letter}\\p{Letter}*)", 'g'); |
1114 | 1114 | } else {
|
1115 | 1115 | // Protect all upper case letters, even if the uppercase letter is only in
|
1116 | 1116 | // initial position of the word.
|
1117 | 1117 | // Don't protect first word if only first letter is capitalized
|
1118 | 1118 | protectCapsRE = new ZU.XRegExp(
|
1119 | 1119 | "(.)\\b(\\p{Letter}*\\p{Uppercase_Letter}\\p{Letter}*)" // Non-initial words with capital letter anywhere
|
1120 |
| - + "|^()(\\p{Letter}+\\p{Uppercase_Letter}\\p{Letter}*)" // Initial word with capital in non-initial position |
| 1120 | + + "|^(\\p{Letter}+\\p{Uppercase_Letter}\\p{Letter}*)" // Initial word with capital in non-initial position |
1121 | 1121 | , 'g');
|
1122 | 1122 | }
|
1123 | 1123 |
|
|
0 commit comments