commit 6e21bb4b5722741d67dabd479b7c50542f1659e3
parent 55ee55ed7b7090b1e587339f16d0e96bd66a7be3
Author: Dan Stillman <dstillman@zotero.org>
Date: Thu, 3 Nov 2016 10:11:54 -0400
Update citeproc-js to 1.1.139
Diffstat:
1 file changed, 10 insertions(+), 14 deletions(-)
diff --git a/chrome/content/zotero/xpcom/citeproc.js b/chrome/content/zotero/xpcom/citeproc.js
@@ -23,7 +23,7 @@
* <http://www.gnu.org/licenses/> respectively.
*/
var CSL = {
- PROCESSOR_VERSION: "1.1.138",
+ PROCESSOR_VERSION: "1.1.139",
CONDITION_LEVEL_TOP: 1,
CONDITION_LEVEL_BOTTOM: 2,
PLAIN_HYPHEN_REGEX: /(?:[^\\]-|\u2013)/,
@@ -2967,21 +2967,13 @@ CSL.Engine.prototype.setOpt = function (token, name, value) {
}
};
CSL.Engine.prototype.inheritOpt = function (token, attrname, parentname, defaultValue) {
- if (parentname === "name-form") {
- }
if ("undefined" !== typeof token.strings[attrname]) {
- if (parentname === "name-form") {
- }
return token.strings[attrname];
} else {
var parentValue = this[this.tmp.root].opt.inheritedAttributes[parentname ? parentname : attrname];
if ("undefined" !== typeof parentValue) {
- if (parentname === "name-form") {
- }
return parentValue;
} else {
- if (parentname === "name-form") {
- }
return defaultValue;
}
}
@@ -5921,7 +5913,7 @@ CSL.Engine.prototype.setCitationId = function (citation, force) {
while (true) {
direction = 0;
if (!this.registry.citationreg.citationById[id]) {
- citation.citationID = id.toString(32);
+ citation.citationID = "a" + id.toString(32);
break;
} else if (!direction && id < 50000000000000) {
direction = 1;
@@ -8564,11 +8556,11 @@ CSL.NameOutput.prototype._runDisambigNames = function (lst, pos) {
}
chk = this.state.tmp.disambig_settings.givens[pos][i];
if ("undefined" === typeof chk) {
- myform = this.state.inheritOpt(this.name, "form", "name-form");
+ myform = this.state.inheritOpt(this.name, "form", "name-form", "long");
param = this.state.registry.namereg.evalname("" + this.Item.id, lst[i], i, 0, myform, myinitials);
this.state.tmp.disambig_settings.givens[pos].push(param);
}
- myform = this.state.inheritOpt(this.name, "form", "name-form");
+ myform = this.state.inheritOpt(this.name, "form", "name-form", "long");
paramx = this.state.registry.namereg.evalname("" + this.Item.id, lst[i], i, 0, myform, myinitials);
if (this.state.tmp.disambig_request) {
var val = this.state.tmp.disambig_settings.givens[pos][i];
@@ -8580,7 +8572,7 @@ CSL.NameOutput.prototype._runDisambigNames = function (lst, pos) {
}
param = val;
if (this.state.opt["disambiguate-add-givenname"] && lst[i].given) {
- param = this.state.registry.namereg.evalname("" + this.Item.id, lst[i], i, param, this.state.inheritOpt(this.name, "form", "name-form"), this.state.inheritOpt(this.name, "initialize-with"));
+ param = this.state.registry.namereg.evalname("" + this.Item.id, lst[i], i, param, this.state.inheritOpt(this.name, "form", "name-form", "long"), this.state.inheritOpt(this.name, "initialize-with"));
}
} else {
param = paramx;
@@ -13991,7 +13983,11 @@ CSL.Util.outputNumericField = function(state, varname, itemID) {
}
}
if (num.collapsible) {
- var blob = new CSL.NumericBlob(num.particle, parseInt(num.value, 10), numStyling, itemID);
+ if (num.value.match(/^[0-9]+$/)) {
+ var blob = new CSL.NumericBlob(num.particle, parseInt(num.value, 10), numStyling, itemID);
+ } else {
+ var blob = new CSL.NumericBlob(num.particle, num.value, numStyling, itemID);
+ }
if ("undefined" === typeof blob.gender) {
blob.gender = state.locale[state.opt.lang]["noun-genders"][varname];
}