@iebh/polyglot 5.1.7 → 5.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/modules/tools.js +2 -5
- package/package.json +1 -1
package/lib/modules/tools.js
CHANGED
|
@@ -114,7 +114,7 @@ var tools = {
|
|
|
114
114
|
})) {
|
|
115
115
|
foundMatch = true;
|
|
116
116
|
// Add quotation marks to previous word/s if the previous word was not a match
|
|
117
|
-
if (i - 1 > lastMatch) {
|
|
117
|
+
if (i - 1 > lastMatch + 1) {
|
|
118
118
|
words[lastMatch + 1] = highlighting ? '<font color="DarkBlue">"' + words[lastMatch + 1] : '"' + words[lastMatch + 1];
|
|
119
119
|
words[i - 1] = highlighting ? words[i - 1] + '"</font>' : words[i - 1] + '"';
|
|
120
120
|
}
|
|
@@ -135,7 +135,7 @@ var tools = {
|
|
|
135
135
|
_loop(i);
|
|
136
136
|
}
|
|
137
137
|
// Add quotation marks to word/s after the final match
|
|
138
|
-
if (lastMatch + 1 < words.length) {
|
|
138
|
+
if (lastMatch + 1 < words.length - 1) {
|
|
139
139
|
words[lastMatch + 1] = highlighting ? '<font color="DarkBlue">"' + words[lastMatch + 1] : '"' + words[lastMatch + 1];
|
|
140
140
|
words[words.length - 1] = highlighting ? words[words.length - 1] + '"</font>' : words[words.length - 1] + '"';
|
|
141
141
|
}
|
|
@@ -309,9 +309,6 @@ var tools = {
|
|
|
309
309
|
break;
|
|
310
310
|
}
|
|
311
311
|
text = tools.multiReplace(text, replaceObj);
|
|
312
|
-
if (engine == 'Cochrane Library') {
|
|
313
|
-
text = text.replace(/"(\w+)"\s+NEXT/gi, '$1 NEXT');
|
|
314
|
-
}
|
|
315
312
|
}
|
|
316
313
|
return engine == 'Embase (Elsevier)' ? space ? settings.highlighting ? "<font color='DarkBlue'>'" + text + "'</font>" : "'" + text + "'" : text : space ? settings.highlighting ? '<font color="DarkBlue">"' + text + '"</font>' : '"' + text + '"' : text;
|
|
317
314
|
},
|