Don't convert "Type: article" in Extra to Document item

CSL 1.0.2 clarified that type 'article' is meant for preprints and
working papers, so until we have a Preprint item type, just leave it in
Extra.

Discussion: https://github.com/zotero/translators/pull/2248#discussion_r492009958
This commit is contained in:
Dan Stillman 2020-12-21 01:09:23 -05:00
parent aeceb67a07
commit 43e6493997
2 changed files with 15 additions and 2 deletions

View file

@ -1229,8 +1229,10 @@ Zotero.Utilities.Internal = {
if (!key
|| key != 'type'
|| skipKeys.has(key)
// Ignore 'type: note' and 'type: attachment'
|| ['note', 'attachment'].includes(value)) {
// 1) Ignore 'type: note' and 'type: attachment'
// 2) Ignore 'article' until we have a Preprint item type
// (https://github.com/zotero/translators/pull/2248#discussion_r546428184)
|| ['note', 'attachment', 'article'].includes(value)) {
return true;
}

View file

@ -1896,6 +1896,17 @@ describe("Zotero.Item", function () {
assert.equal(item.getField('extra'), 'Pages: 123');
});
it("shouldn't convert 'Type: article' from Extra into Document item", function () {
var json = {
itemType: "report",
extra: "Type: article"
};
var item = new Zotero.Item;
item.fromJSON(json);
assert.equal(Zotero.ItemTypes.getName(item.itemTypeID), 'report');
assert.equal(item.getField('extra'), 'Type: article');
});
it("should ignore creator field in Extra", async function () {
var json = {
itemType: "journalArticle",