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:
parent
aeceb67a07
commit
43e6493997
2 changed files with 15 additions and 2 deletions
|
@ -1229,8 +1229,10 @@ Zotero.Utilities.Internal = {
|
||||||
if (!key
|
if (!key
|
||||||
|| key != 'type'
|
|| key != 'type'
|
||||||
|| skipKeys.has(key)
|
|| skipKeys.has(key)
|
||||||
// Ignore 'type: note' and 'type: attachment'
|
// 1) Ignore 'type: note' and 'type: attachment'
|
||||||
|| ['note', 'attachment'].includes(value)) {
|
// 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;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1896,6 +1896,17 @@ describe("Zotero.Item", function () {
|
||||||
assert.equal(item.getField('extra'), 'Pages: 123');
|
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 () {
|
it("should ignore creator field in Extra", async function () {
|
||||||
var json = {
|
var json = {
|
||||||
itemType: "journalArticle",
|
itemType: "journalArticle",
|
||||||
|
|
Loading…
Reference in a new issue