Upgrade citeproc-js to version 1.0.271

This commit is contained in:
Frank 2012-01-30 16:10:38 +08:00 committed by Simon Kornblith
parent 2eb3a6f4dc
commit b9422b32e6

View File

@ -837,7 +837,7 @@ CSL.Output.Queue.prototype.closeLevel = function (name) {
}
this.current.pop();
};
CSL.Output.Queue.prototype.append = function (str, tokname, notSerious, ignorePredecessor) {
CSL.Output.Queue.prototype.append = function (str, tokname, notSerious, ignorePredecessor, noStripPeriods) {
var token, blob, curr;
var useblob = true;
if (this.state.tmp["doing-macro-with-date"]) {
@ -897,7 +897,7 @@ CSL.Output.Queue.prototype.append = function (str, tokname, notSerious, ignorePr
curr = this.current.value();
}
if ("string" === typeof blob.blobs) {
if (this.state.tmp.strip_periods) {
if (this.state.tmp.strip_periods && !noStripPeriods) {
blob.blobs = blob.blobs.replace(/\./g, "");
}
if (!ignorePredecessor) {
@ -1989,7 +1989,7 @@ CSL.DateParser = function () {
};
CSL.Engine = function (sys, style, lang, forceLang) {
var attrs, langspec, localexml, locale;
this.processor_version = "1.0.270";
this.processor_version = "1.0.271";
this.csl_version = "1.0";
this.sys = sys;
this.sys.xml = new CSL.System.Xml.Parsing();
@ -7093,7 +7093,7 @@ CSL.Node.number = {
}
newstr = state.fun.page_mangler(newstr);
}
if (newstr && !newstr.match(/^[0-9]+$/)) {
if (newstr && !newstr.match(/^[-.\u20130-9]+$/)) {
state.output.append(newstr, this);
} else {
state.output.openLevel("empty");
@ -7105,7 +7105,7 @@ CSL.Node.number = {
if (i < values.length - 1) {
blob.strings.suffix = blob.strings.suffix.replace(/\s*$/, "");
}
state.output.append(blob, "literal");
state.output.append(blob, "literal", false, false, true);
}
state.output.closeLevel("empty");
}
@ -7339,7 +7339,7 @@ CSL.Node.text = {
if (item && item[this.variables[0]]) {
var locator = "" + item[this.variables[0]];
locator = locator.replace(/--*/g,"\u2013");
state.output.append(locator, this);
state.output.append(locator, this, false, false, true);
}
};
} else if (this.variables_real[0] === "page-first") {
@ -7352,7 +7352,7 @@ CSL.Node.text = {
if (idx > -1) {
value = value.slice(0, idx);
}
state.output.append(value, this);
state.output.append(value, this, false, false, true);
}
};
} else if (this.variables_real[0] === "page") {
@ -7360,7 +7360,7 @@ CSL.Node.text = {
var value = state.getVariable(Item, "page", form);
if (value) {
value = state.fun.page_mangler(value);
state.output.append(value, this);
state.output.append(value, this, false, false, true);
}
};
} else if (this.variables_real[0] === "volume") {
@ -7382,6 +7382,16 @@ CSL.Node.text = {
state.output.append(value, this);
}
};
} else if (this.variables_real[0] === "URL") {
func = function (state, Item) {
var value;
if (this.variables[0]) {
value = state.getVariable(Item, this.variables[0], form);
if (value) {
state.output.append(value, this, false, false, true);
}
}
};
} else if (this.variables_real[0] === "section") {
func = function (state, Item) {
var value;