update to citeproc-js 1.0.118
This commit is contained in:
parent
942275a0ae
commit
f834e3f63e
|
@ -86,7 +86,7 @@ var CSL = {
|
||||||
MARK_TRAILING_NAMES: true,
|
MARK_TRAILING_NAMES: true,
|
||||||
POSITION_TEST_VARS: ["position", "first-reference-note-number", "near-note"],
|
POSITION_TEST_VARS: ["position", "first-reference-note-number", "near-note"],
|
||||||
AREAS: ["citation", "citation_sort", "bibliography", "bibliography_sort"],
|
AREAS: ["citation", "citation_sort", "bibliography", "bibliography_sort"],
|
||||||
MULTI_FIELDS: ["publisher", "publisher-place", "title", "container-title", "collection-title", "institution", "authority"],
|
MULTI_FIELDS: ["publisher", "publisher-place", "title","container-title", "collection-title", "institution", "authority","edition"],
|
||||||
CITE_FIELDS: ["first-reference-note-number", "locator"],
|
CITE_FIELDS: ["first-reference-note-number", "locator"],
|
||||||
MINIMAL_NAME_FIELDS: ["literal", "family"],
|
MINIMAL_NAME_FIELDS: ["literal", "family"],
|
||||||
SWAPPING_PUNCTUATION: [".", "!", "?", ":",",",";"],
|
SWAPPING_PUNCTUATION: [".", "!", "?", ":",",",";"],
|
||||||
|
@ -1752,7 +1752,7 @@ CSL.DateParser = function (txt) {
|
||||||
};
|
};
|
||||||
CSL.Engine = function (sys, style, lang, forceLang) {
|
CSL.Engine = function (sys, style, lang, forceLang) {
|
||||||
var attrs, langspec, localexml, locale;
|
var attrs, langspec, localexml, locale;
|
||||||
this.processor_version = "1.0.114";
|
this.processor_version = "1.0.118";
|
||||||
this.csl_version = "1.0";
|
this.csl_version = "1.0";
|
||||||
this.sys = sys;
|
this.sys = sys;
|
||||||
this.sys.xml = new CSL.System.Xml.Parsing();
|
this.sys.xml = new CSL.System.Xml.Parsing();
|
||||||
|
@ -3182,14 +3182,10 @@ CSL.citeEnd = function (Item) {
|
||||||
} else if (this.tmp.prefix.value() && this.tmp.prefix.value().match(/^[.,:;a-z]/)) {
|
} else if (this.tmp.prefix.value() && this.tmp.prefix.value().match(/^[.,:;a-z]/)) {
|
||||||
this.tmp.splice_delimiter = " ";
|
this.tmp.splice_delimiter = " ";
|
||||||
}
|
}
|
||||||
this.tmp.last_suffix_used = this.tmp.suffix.value();
|
this.tmp.last_suffix_used = this.tmp.suffix.value();
|
||||||
this.tmp.last_years_used = this.tmp.years_used.slice();
|
this.tmp.last_years_used = this.tmp.years_used.slice();
|
||||||
this.tmp.last_names_used = this.tmp.names_used.slice();
|
this.tmp.last_names_used = this.tmp.names_used.slice();
|
||||||
this.tmp.cut_var = false;
|
this.tmp.cut_var = false;
|
||||||
if (this.tmp.disambig_restore && this.registry.registry[Item.id]) {
|
|
||||||
this.registry.registry[Item.id].disambig = this.tmp.disambig_restore;
|
|
||||||
}
|
|
||||||
this.tmp.disambig_restore = false;
|
|
||||||
this.tmp.disambig_request = false;
|
this.tmp.disambig_request = false;
|
||||||
if (!this.tmp.suppress_decorations && this.tmp.offset_characters) {
|
if (!this.tmp.suppress_decorations && this.tmp.offset_characters) {
|
||||||
this.registry.registry[Item.id].offset = this.tmp.offset_characters;
|
this.registry.registry[Item.id].offset = this.tmp.offset_characters;
|
||||||
|
@ -4286,6 +4282,7 @@ CSL.Node.layout = {
|
||||||
this.execs.push(func);
|
this.execs.push(func);
|
||||||
target.push(this);
|
target.push(this);
|
||||||
state.build.layout_flag = false;
|
state.build.layout_flag = false;
|
||||||
|
state.build.layout_locale_flag = false;
|
||||||
} // !this.layout_raw
|
} // !this.layout_raw
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4833,7 +4830,7 @@ CSL.Node.names = {
|
||||||
} else {
|
} else {
|
||||||
param = paramx;
|
param = paramx;
|
||||||
}
|
}
|
||||||
if (!state.tmp.just_looking && item && item.position === CSL.POSITION_FIRST) {
|
if (!state.tmp.disambig_restore && !state.tmp.just_looking && item && item.position === CSL.POSITION_FIRST) {
|
||||||
state.tmp.disambig_restore = CSL.cloneAmbigConfig(state.tmp.disambig_settings);
|
state.tmp.disambig_restore = CSL.cloneAmbigConfig(state.tmp.disambig_settings);
|
||||||
param = paramx;
|
param = paramx;
|
||||||
}
|
}
|
||||||
|
@ -4928,6 +4925,11 @@ CSL.Node.names = {
|
||||||
state.tmp.use_ellipsis = false;
|
state.tmp.use_ellipsis = false;
|
||||||
state.tmp.can_block_substitute = false;
|
state.tmp.can_block_substitute = false;
|
||||||
state.tmp.forceEtAl = false;
|
state.tmp.forceEtAl = false;
|
||||||
|
if (state.tmp.disambig_restore && state.registry.registry[Item.id]) {
|
||||||
|
state.registry.registry[Item.id].disambig.names = state.tmp.disambig_restore.names;
|
||||||
|
state.registry.registry[Item.id].disambig.givens = state.tmp.disambig_restore.givens;
|
||||||
|
}
|
||||||
|
state.tmp.disambig_restore = false;
|
||||||
};
|
};
|
||||||
this.execs.push(func);
|
this.execs.push(func);
|
||||||
state.build.names_flag = false;
|
state.build.names_flag = false;
|
||||||
|
@ -5272,7 +5274,7 @@ CSL.Node.text = {
|
||||||
state.transform.setAlternativeVariableName("journalAbbreviation");
|
state.transform.setAlternativeVariableName("journalAbbreviation");
|
||||||
} else if (this.variables[0] === "title") {
|
} else if (this.variables[0] === "title") {
|
||||||
state.transform.setAlternativeVariableName("shortTitle");
|
state.transform.setAlternativeVariableName("shortTitle");
|
||||||
} else if (["publisher", "publisher-place"].indexOf(this.variables[0]) > -1) {
|
} else if (["publisher", "publisher-place", "edition"].indexOf(this.variables[0]) > -1) {
|
||||||
state.transform.setTransformLocale("default-locale");
|
state.transform.setTransformLocale("default-locale");
|
||||||
}
|
}
|
||||||
func = state.transform.getOutputFunction();
|
func = state.transform.getOutputFunction();
|
||||||
|
@ -5283,7 +5285,7 @@ CSL.Node.text = {
|
||||||
} else {
|
} else {
|
||||||
state.transform.setTransformLocale("locale-pri");
|
state.transform.setTransformLocale("locale-pri");
|
||||||
state.transform.setTransformFallback(true);
|
state.transform.setTransformFallback(true);
|
||||||
if (["publisher", "publisher-place"].indexOf(this.variables[0]) > -1) {
|
if (["publisher", "publisher-place", "edition"].indexOf(this.variables[0]) > -1) {
|
||||||
state.transform.setTransformLocale("default-locale");
|
state.transform.setTransformLocale("default-locale");
|
||||||
}
|
}
|
||||||
func = state.transform.getOutputFunction();
|
func = state.transform.getOutputFunction();
|
||||||
|
@ -7106,7 +7108,7 @@ CSL.Util.Names.getCommonTerm = function (state, namesets) {
|
||||||
}
|
}
|
||||||
base_nameset = namesets[0];
|
base_nameset = namesets[0];
|
||||||
varnames = [];
|
varnames = [];
|
||||||
varnames.push(base_nameset.variable);
|
varnames.push(base_nameset.variable);
|
||||||
short_namesets = namesets.slice(1);
|
short_namesets = namesets.slice(1);
|
||||||
len = short_namesets.length;
|
len = short_namesets.length;
|
||||||
for (pos = 0; pos < len; pos += 1) {
|
for (pos = 0; pos < len; pos += 1) {
|
||||||
|
@ -7119,7 +7121,12 @@ CSL.Util.Names.getCommonTerm = function (state, namesets) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
varnames.sort();
|
varnames.sort();
|
||||||
return varnames.join("");
|
var combined_terms = varnames.join("");
|
||||||
|
if (state.locale[state.opt.lang].terms[combined_terms]) {
|
||||||
|
return varnames.join("");
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
CSL.Util.Names.compareNamesets = function (base_nameset, nameset) {
|
CSL.Util.Names.compareNamesets = function (base_nameset, nameset) {
|
||||||
var name, pos, len, part, ppos, llen;
|
var name, pos, len, part, ppos, llen;
|
||||||
|
@ -7464,7 +7471,7 @@ CSL.Util.substituteStart = function (state, target) {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
CSL.Util.substituteEnd = function (state, target) {
|
CSL.Util.substituteEnd = function (state, target) {
|
||||||
var func, bib_first_end, bib_other, if_end, choose_end, toplevel, hasval, author_substitute, printing, str;
|
var func, bib_first_end, bib_other, if_end, choose_end, toplevel, hasval, author_substitute, str;
|
||||||
state.build.render_nesting_level += -1;
|
state.build.render_nesting_level += -1;
|
||||||
if (state.build.render_nesting_level === 0) {
|
if (state.build.render_nesting_level === 0) {
|
||||||
if (state.build.cls) {
|
if (state.build.cls) {
|
||||||
|
@ -7510,13 +7517,14 @@ CSL.Util.substituteEnd = function (state, target) {
|
||||||
if (toplevel && hasval) {
|
if (toplevel && hasval) {
|
||||||
author_substitute = new CSL.Token("text", CSL.SINGLETON);
|
author_substitute = new CSL.Token("text", CSL.SINGLETON);
|
||||||
func = function (state, Item) {
|
func = function (state, Item) {
|
||||||
printing = !state.tmp.suppress_decorations;
|
var text_esc = CSL.Output.Formats[state.opt.mode].text_escape;
|
||||||
|
var printing = !state.tmp.suppress_decorations;
|
||||||
if (printing) {
|
if (printing) {
|
||||||
if (!state.tmp.rendered_name) {
|
if (!state.tmp.rendered_name) {
|
||||||
state.tmp.rendered_name = state.output.string(state, state.tmp.name_node.blobs, false);
|
state.tmp.rendered_name = state.output.string(state, state.tmp.name_node.blobs, false);
|
||||||
if (state.tmp.rendered_name) {
|
if (state.tmp.rendered_name) {
|
||||||
if (state.tmp.rendered_name === state.tmp.last_rendered_name) {
|
if (state.tmp.rendered_name === state.tmp.last_rendered_name) {
|
||||||
str = new CSL.Blob(false, state[state.tmp.area].opt["subsequent-author-substitute"]);
|
str = new CSL.Blob(false, text_esc(state[state.tmp.area].opt["subsequent-author-substitute"]));
|
||||||
state.tmp.name_node.blobs = [str];
|
state.tmp.name_node.blobs = [str];
|
||||||
}
|
}
|
||||||
state.tmp.last_rendered_name = state.tmp.rendered_name;
|
state.tmp.last_rendered_name = state.tmp.rendered_name;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user