diff --git a/chrome/content/zotero/xpcom/utilities_internal.js b/chrome/content/zotero/xpcom/utilities_internal.js index 0a2bd62daa..cabcd4f29c 100644 --- a/chrome/content/zotero/xpcom/utilities_internal.js +++ b/chrome/content/zotero/xpcom/utilities_internal.js @@ -1012,6 +1012,11 @@ Zotero.Utilities.Internal = { if (key == 'type') { let possibleType = itemTypes.get(value); if (possibleType) { + // Ignore 'type: note' and 'type: attachment' + if (['note', 'attachment'].includes(possibleType)) { + keepLines.push(line); + continue; + } // Ignore item type that's the same as the item if (!item || possibleType != Zotero.ItemTypes.getName(itemTypeID)) { itemType = possibleType; diff --git a/test/tests/utilities_internalTest.js b/test/tests/utilities_internalTest.js index 66b947c8dd..4c56f94cdd 100644 --- a/test/tests/utilities_internalTest.js +++ b/test/tests/utilities_internalTest.js @@ -114,6 +114,13 @@ describe("Zotero.Utilities.Internal", function () { describe("#extractExtraFields()", function () { + it("should ignore 'type: note' and 'type: attachment'", function () { + var str = 'type: note'; + var { itemType, extra } = Zotero.Utilities.Internal.extractExtraFields(str); + assert.isNull(itemType); + assert.equal(extra, 'type: note'); + }); + it("should extract a CSL type", function () { var str = 'type: motion_picture'; var { itemType, fields, extra } = Zotero.Utilities.Internal.extractExtraFields(str);