Skip to content

Commit

Permalink
Implement use-first on names shortened with institution-parts="short"
Browse files Browse the repository at this point in the history
  • Loading branch information
fbennett committed Apr 13, 2020
1 parent ff218b8 commit 642a282
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/util_names_render.js
Original file line number Diff line number Diff line change
Expand Up @@ -1004,6 +1004,17 @@ CSL.NameOutput.prototype.fixupInstitution = function (name, varname, listpos) {
}
}
if (use_short_form) {
var delimiter = this.institution.strings.delimiter;
var use_first = this.institution.strings["use-first"];
if (use_first) {
if (!delimiter) {
delimiter = "|";
}
var buf = [];
for (var i=0,ilen=short_form.length;i<ilen;i++) {
short_form[i] = short_form[i].split("|").slice(0, use_first).join(delimiter);
}
}
name["short"] = short_form;
} else {
name["short"] = [];
Expand Down

0 comments on commit 642a282

Please sign in to comment.