diff --git a/chrome/content/zotero/xpcom/cite.js b/chrome/content/zotero/xpcom/cite.js index 68db2afede..d9d0c7c727 100644 --- a/chrome/content/zotero/xpcom/cite.js +++ b/chrome/content/zotero/xpcom/cite.js @@ -584,13 +584,20 @@ Zotero.Cite.getAbbreviation = new function() { /** * citeproc-js system object + * * @class + * @param {Object} options + * @param {Boolean} [options.automaticJournalAbbreviations] + * @param {Boolean} [options.uppercaseSubtitles] */ -Zotero.Cite.System = function(automaticJournalAbbreviations) { - if(automaticJournalAbbreviations) { +Zotero.Cite.System = function ({ automaticJournalAbbreviations, uppercaseSubtitles }) { + if (automaticJournalAbbreviations) { this.getAbbreviation = Zotero.Cite.getAbbreviation; } -} + if (uppercaseSubtitles) { + this.uppercase_subtitles = true; // eslint-disable-line camelcase + } +}; Zotero.Cite.System.prototype = { /** diff --git a/chrome/content/zotero/xpcom/style.js b/chrome/content/zotero/xpcom/style.js index a65b949eab..88e9e8d81f 100644 --- a/chrome/content/zotero/xpcom/style.js +++ b/chrome/content/zotero/xpcom/style.js @@ -648,6 +648,8 @@ Zotero.Style = function (style, path) { Zotero.Styles.ns).replace(/(.+)T([^\+]+)\+?.*/, "$1 $2"); this.locale = Zotero.Utilities.xpathText(doc, '/csl:style/@default-locale', Zotero.Styles.ns) || null; + var shortID = this.styleID.match(/\/?([^/]+)$/)[1]; + this._isAPA = /^apa($|-)/.test(shortID); this._class = doc.documentElement.getAttribute("class"); this._usesAbbreviation = !!Zotero.Utilities.xpath(doc, '//csl:text[(@variable="container-title" and @form="short") or (@variable="container-title-short")][1]', @@ -745,7 +747,10 @@ Zotero.Style.prototype.getCiteProc = function(locale, automaticJournalAbbreviati try { var citeproc = new Zotero.CiteProc.CSL.Engine( - new Zotero.Cite.System(automaticJournalAbbreviations), + new Zotero.Cite.System({ + automaticJournalAbbreviations, + uppercaseSubtitles: this._isAPA + }), xml, locale, overrideLocale