@iebh/polyglot 5.1.6 → 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 -3
- 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
|
}
|
|
@@ -209,7 +209,6 @@ var tools = {
|
|
|
209
209
|
case 'Cochrane Library':
|
|
210
210
|
if (space) {
|
|
211
211
|
text = tools.wildCardCochrane(text, settings.highlighting);
|
|
212
|
-
text = text.replace(/"(\w+)"\s+NEXT/gi, '$1 NEXT');
|
|
213
212
|
}
|
|
214
213
|
replaceObj = {
|
|
215
214
|
// '$': settings.highlighting
|