From e618410eb2988c0a5a4f474a067f2ec9bcd56b3f Mon Sep 17 00:00:00 2001 From: Frank Bennett Date: Thu, 4 Apr 2019 00:45:32 +0900 Subject: [PATCH] Export CSL JSON with title-short rather than shortTitle --- chrome/content/zotero/xpcom/utilities.js | 4 +- test/tests/data/citeProcJSExport.js | 70 ++++++++++++------------ test/tests/utilitiesTest.js | 17 ++++++ 3 files changed, 55 insertions(+), 36 deletions(-) diff --git a/chrome/content/zotero/xpcom/utilities.js b/chrome/content/zotero/xpcom/utilities.js index e99f83445b..69dfb6308f 100644 --- a/chrome/content/zotero/xpcom/utilities.js +++ b/chrome/content/zotero/xpcom/utilities.js @@ -82,7 +82,8 @@ var CSL_TEXT_MAPPINGS = { "number":["number"], "chapter-number":["session"], "references":["history", "references"], - "shortTitle":["shortTitle"], + "shortTitle":["shortTitle"], /* preserved to read legacy data */ + "title-short":["shortTitle"], "journalAbbreviation":["journalAbbreviation"], "status":["legalStatus"], "language":["language"] @@ -1588,6 +1589,7 @@ Zotero.Utilities = { // get all text variables (there must be a better way) for(var variable in CSL_TEXT_MAPPINGS) { + if (variable === "shortTitle") continue; // read both title-short and shortTitle, but write only title-short var fields = CSL_TEXT_MAPPINGS[variable]; for(var i=0, n=fields.length; i