@iebh/polyglot 4.7.2 → 4.7.3
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/parse.js +13 -6
- package/package.json +1 -1
package/lib/modules/parse.js
CHANGED
|
@@ -348,7 +348,9 @@ var parse = function parse(query, options) {
|
|
|
348
348
|
leaf.type = 'mesh';
|
|
349
349
|
leaf.field = match[2] ? 'Mesh search (Not exploded)' : 'Mesh search (exploded)';
|
|
350
350
|
// if (/^["“”].*["“”]$/.test(leaf.content)) leaf.content = leaf.content.substr(1, leaf.content.length - 2); // Remove wrapping '"' characters
|
|
351
|
-
if (/^["“”'‘’].*["“”'‘’]$/.test(leaf.content)
|
|
351
|
+
if (/^["“”'‘’].*["“”'‘’]$/.test(leaf.content)) leaf.content = leaf.content.substr(1, leaf.content.length - 2); // Remove wrapping '"' characters
|
|
352
|
+
// if (/^["“”'‘’].*["“”'‘’]$/.test(leaf.content) && ['"', '“', '”', "'", '‘', '’'].includes(leaf.content[0]) && ['"', '“', '”', "'", '‘', '’'].includes(leaf.content.slice(-1))) leaf.content = leaf.content.slice(1, -1);
|
|
353
|
+
|
|
352
354
|
offset += match[0].length;
|
|
353
355
|
q = q.substr(match[0].length);
|
|
354
356
|
cropString = false;
|
|
@@ -362,7 +364,8 @@ var parse = function parse(query, options) {
|
|
|
362
364
|
}
|
|
363
365
|
newLeaf.field = match[4] ? 'MeSH Major Topic search (Not exploded)' : 'MeSH Major Topic search (exploded)';
|
|
364
366
|
// if (/^["“”].*["“”]$/.test(newLeaf.content)) newLeaf.content = newLeaf.content.substr(1, newLeaf.content.length - 2); // Remove wrapping '"' characters
|
|
365
|
-
if (/^["“”'‘’].*["“”'‘’]$/.test(leaf.content)
|
|
367
|
+
if (/^["“”'‘’].*["“”'‘’]$/.test(leaf.content)) leaf.content = leaf.content.substr(1, leaf.content.length - 2); // Remove wrapping '"' characters
|
|
368
|
+
// if (/^["“”'‘’].*["“”'‘’]$/.test(leaf.content) && ['"', '“', '”', "'", '‘', '’'].includes(leaf.content[0]) && ['"', '“', '”', "'", '‘', '’'].includes(leaf.content.slice(-1))) leaf.content = leaf.content.slice(1, -1);
|
|
366
369
|
branch.nodes.push(newLeaf);
|
|
367
370
|
offset += match[0].length;
|
|
368
371
|
q = q.substr(match[0].length);
|
|
@@ -377,7 +380,8 @@ var parse = function parse(query, options) {
|
|
|
377
380
|
}
|
|
378
381
|
newLeaf.field = match[4] ? 'MeSH Major Topic search (Not exploded)' : 'MeSH Major Topic search (exploded)';
|
|
379
382
|
// if (/^["“”].*["“”]$/.test(newLeaf.content)) newLeaf.content = newLeaf.content.substr(1, newLeaf.content.length - 2); // Remove wrapping '"' characters
|
|
380
|
-
if (/^["“”'‘’].*["“”'‘’]$/.test(leaf.content)
|
|
383
|
+
if (/^["“”'‘’].*["“”'‘’]$/.test(leaf.content)) leaf.content = leaf.content.substr(1, leaf.content.length - 2); // Remove wrapping '"' characters
|
|
384
|
+
// if (/^["“”'‘’].*["“”'‘’]$/.test(leaf.content) && ['"', '“', '”', "'", '‘', '’'].includes(leaf.content[0]) && ['"', '“', '”', "'", '‘', '’'].includes(leaf.content.slice(-1))) leaf.content = leaf.content.slice(1, -1);
|
|
381
385
|
branch.nodes.push(newLeaf);
|
|
382
386
|
offset += match[0].length;
|
|
383
387
|
q = q.substr(match[0].length);
|
|
@@ -387,7 +391,8 @@ var parse = function parse(query, options) {
|
|
|
387
391
|
leaf.type = 'mesh';
|
|
388
392
|
leaf.field = 'MeSH subheading search';
|
|
389
393
|
// if (/^["“”].*["“”]$/.test(leaf.content)) leaf.content = leaf.content.substr(1, leaf.content.length - 2); // Remove wrapping '"' characters
|
|
390
|
-
if (/^["“”'‘’].*["“”'‘’]$/.test(leaf.content)
|
|
394
|
+
if (/^["“”'‘’].*["“”'‘’]$/.test(leaf.content)) leaf.content = leaf.content.substr(1, leaf.content.length - 2); // Remove wrapping '"' characters
|
|
395
|
+
// if (/^["“”'‘’].*["“”'‘’]$/.test(leaf.content) && ['"', '“', '”', "'", '‘', '’'].includes(leaf.content[0]) && ['"', '“', '”', "'", '‘', '’'].includes(leaf.content.slice(-1))) leaf.content = leaf.content.slice(1, -1);
|
|
391
396
|
offset += match[0].length;
|
|
392
397
|
q = q.substr(match[0].length);
|
|
393
398
|
cropString = false;
|
|
@@ -402,7 +407,8 @@ var parse = function parse(query, options) {
|
|
|
402
407
|
leaf.type = 'mesh';
|
|
403
408
|
useLeaf.field = 'MeSH subheading search';
|
|
404
409
|
// if (/^["“”].*["“”]$/.test(leaf.content)) leaf.content = leaf.content.substr(1, leaf.content.length - 2); // Remove wrapping '"' characters
|
|
405
|
-
if (/^["“”'‘’].*["“”'‘’]$/.test(leaf.content)
|
|
410
|
+
if (/^["“”'‘’].*["“”'‘’]$/.test(leaf.content)) leaf.content = leaf.content.substr(1, leaf.content.length - 2); // Remove wrapping '"' characters
|
|
411
|
+
// if (/^["“”'‘’].*["“”'‘’]$/.test(leaf.content) && ['"', '“', '”', "'", '‘', '’'].includes(leaf.content[0]) && ['"', '“', '”', "'", '‘', '’'].includes(leaf.content.slice(-1))) leaf.content = leaf.content.slice(1, -1);
|
|
406
412
|
offset += match[0].length;
|
|
407
413
|
q = q.substr(match[0].length);
|
|
408
414
|
cropString = false;
|
|
@@ -417,7 +423,8 @@ var parse = function parse(query, options) {
|
|
|
417
423
|
leaf.type = 'mesh';
|
|
418
424
|
useLeaf.field = match[1] === "xm" ? 'Mesh search (exploded)' : 'Mesh search (Not exploded)';
|
|
419
425
|
// if (/^["“”].*["“”]$/.test(leaf.content)) leaf.content = leaf.content.substr(1, leaf.content.length - 2); // Remove wrapping '"' characters
|
|
420
|
-
if (/^["“”'‘’].*["“”'‘’]$/.test(leaf.content)
|
|
426
|
+
if (/^["“”'‘’].*["“”'‘’]$/.test(leaf.content)) leaf.content = leaf.content.substr(1, leaf.content.length - 2); // Remove wrapping '"' characters
|
|
427
|
+
// if (/^["“”'‘’].*["“”'‘’]$/.test(leaf.content) && ['"', '“', '”', "'", '‘', '’'].includes(leaf.content[0]) && ['"', '“', '”', "'", '‘', '’'].includes(leaf.content.slice(-1))) leaf.content = leaf.content.slice(1, -1);
|
|
421
428
|
offset += match[0].length;
|
|
422
429
|
q = q.substr(match[0].length);
|
|
423
430
|
cropString = false;
|