Skip to content

Commit

Permalink
Align disambig priorities with spec by default
Browse files Browse the repository at this point in the history
  • Loading branch information
fbennett committed Apr 19, 2019
1 parent d974bf1 commit 379f284
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 5 deletions.
3 changes: 3 additions & 0 deletions src/build.js
Expand Up @@ -104,6 +104,9 @@ CSL.Engine = function (sys, style, lang, forceLang) {
};
this.setCslNodeIds(this.cslXml.dataObj, "style");
}
if ("boolean" === typeof this.sys.prioritize_disambiguate_condition) {
this.opt.development_extensions.prioritize_disambiguate_condition = this.sys.prioritize_disambiguate_condition;
}
// Preprocessing ops for the XML input
this.cslXml.addMissingNameNodes(this.cslXml.dataObj);
this.cslXml.addInstitutionNodes(this.cslXml.dataObj);
Expand Down
20 changes: 15 additions & 5 deletions src/disambig_cites.js
Expand Up @@ -526,11 +526,21 @@ CSL.Disambiguation.prototype.configModes = function () {
if (this.state.opt['disambiguate-add-names'] || (dagopt && gdropt === "by-cite")) {
this.modes.push("disNames");
}
if (this.state.opt.has_disambiguate) {
this.modes.push("disExtraText");
}
if (this.state.opt["disambiguate-add-year-suffix"]) {
this.modes.push("disYears");

if (this.state.opt.development_extensions.prioritize_disambiguate_condition) {
if (this.state.opt.has_disambiguate) {
this.modes.push("disExtraText");
}
if (this.state.opt["disambiguate-add-year-suffix"]) {
this.modes.push("disYears");
}
} else {
if (this.state.opt["disambiguate-add-year-suffix"]) {
this.modes.push("disYears");
}
if (this.state.opt.has_disambiguate) {
this.modes.push("disExtraText");
}
}
};

Expand Down
1 change: 1 addition & 0 deletions src/state.js
Expand Up @@ -168,6 +168,7 @@ CSL.Engine.Opt = function () {
this.development_extensions.hanging_indent_legacy_number = false;
this.development_extensions.throw_on_empty = false;
this.development_extensions.strict_inputs = true;
this.development_extensions.prioritize_disambiguate_condition = false;
};

CSL.Engine.Tmp = function () {
Expand Down

0 comments on commit 379f284

Please sign in to comment.