Update citeproc-js to 1.0.539

This commit is contained in:
Simon Kornblith 2014-09-01 15:04:36 -04:00
parent 14a5643f38
commit 5857368131

View file

@ -80,7 +80,7 @@ if (!Array.indexOf) {
}; };
} }
var CSL = { var CSL = {
PROCESSOR_VERSION: "1.0.536", PROCESSOR_VERSION: "1.0.539",
CONDITION_LEVEL_TOP: 1, CONDITION_LEVEL_TOP: 1,
CONDITION_LEVEL_BOTTOM: 2, CONDITION_LEVEL_BOTTOM: 2,
PLAIN_HYPHEN_REGEX: /(?:[^\\]-|\u2013)/, PLAIN_HYPHEN_REGEX: /(?:[^\\]-|\u2013)/,
@ -1029,11 +1029,16 @@ CSL.getSortCompare = function (default_locale) {
return CSL.stringCompare; return CSL.stringCompare;
} }
var strcmp; var strcmp;
var strcmp_opts = {
sensitivity:"base",
ignorePunctuation:true,
numeric:true
}
if (!default_locale) { if (!default_locale) {
default_locale = "en-US"; default_locale = "en-US";
} }
strcmp = function (a, b) { strcmp = function (a, b) {
return a.toLocaleLowerCase().localeCompare(b.toLocaleLowerCase()); return a.toLocaleLowerCase().localeCompare(b.toLocaleLowerCase(),default_locale,strcmp_opts);
}; };
var stripPunct = function (str) { var stripPunct = function (str) {
return str.replace(/^[\[\]\'\"]*/g, ""); return str.replace(/^[\[\]\'\"]*/g, "");
@ -4262,6 +4267,7 @@ CSL.getAmbiguousCite = function (Item, disambig, visualForm) {
}; };
if (this.registry.registry[Item.id] if (this.registry.registry[Item.id]
&& this.registry.citationreg.citationsByItemId && this.registry.citationreg.citationsByItemId
&& this.registry.citationreg.citationsByItemId[Item.id]
&& this.registry.citationreg.citationsByItemId[Item.id].length && this.registry.citationreg.citationsByItemId[Item.id].length
&& visualForm) { && visualForm) {
if (this.citation.opt["givenname-disambiguation-rule"] === "by-cite") { if (this.citation.opt["givenname-disambiguation-rule"] === "by-cite") {
@ -7362,7 +7368,9 @@ CSL.NameOutput.prototype._runDisambigNames = function (lst, pos) {
param = paramx; param = paramx;
} }
if (!this.state.tmp.just_looking && this.item && this.item.position === CSL.POSITION_FIRST) { if (!this.state.tmp.just_looking && this.item && this.item.position === CSL.POSITION_FIRST) {
param = paramx; if (paramx > param) {
param = paramx;
}
} }
if (!this.state.tmp.sort_key_flag) { if (!this.state.tmp.sort_key_flag) {
this.state.tmp.disambig_settings.givens[pos][i] = param; this.state.tmp.disambig_settings.givens[pos][i] = param;