diff --git a/chrome/content/zotero/import/mendeley/mendeleyImport.js b/chrome/content/zotero/import/mendeley/mendeleyImport.js index 1e54e233c7..7c37816f5b 100644 --- a/chrome/content/zotero/import/mendeley/mendeleyImport.js +++ b/chrome/content/zotero/import/mendeley/mendeleyImport.js @@ -1241,7 +1241,7 @@ Zotero_Import_Mendeley.prototype._makeCreator = function (creatorType, firstName Zotero_Import_Mendeley.prototype._addExtraField = function (extra, field, val) { // Strip the field if it appears at the beginning of the value (to avoid "DOI: DOI: 10...") if (typeof val == 'string') { - val = val.replace(new RegExp(`^${field}:\s*`, 'i'), ""); + val = val.replace(new RegExp(`^${field}:\\s*`, 'i'), ""); } extra = extra ? extra + '\n' : ''; if (field != 'arXiv') { diff --git a/test/tests/data/mendeleyMock/items-simple.json b/test/tests/data/mendeleyMock/items-simple.json index 997edbe792..ff3aa22494 100644 --- a/test/tests/data/mendeleyMock/items-simple.json +++ b/test/tests/data/mendeleyMock/items-simple.json @@ -14,7 +14,7 @@ "identifiers": { "doi": "10.1111", - "pmid": "11111111", + "pmid": "PMID: 11111111", "arxiv": "1111.2222" }, "starred": false, diff --git a/test/tests/mendeleyImportTest.js b/test/tests/mendeleyImportTest.js index 796a34cd2e..a4b65ff887 100644 --- a/test/tests/mendeleyImportTest.js +++ b/test/tests/mendeleyImportTest.js @@ -174,8 +174,7 @@ describe('Zotero_Import_Mendeley', function () { // identifiers assert.equal(journal.getField('DOI'), '10.1111'); - assert.include(journal.getField('extra'), 'PMID: 11111111'); - assert.include(journal.getField('extra'), 'arXiv: 1111.2222'); + assert.sameMembers(journal.getField('extra').split('\n'), ['PMID: 11111111', 'arXiv: 1111.2222']); // attachment & annotations assert.lengthOf(withpdf.getAttachments(), 1);