Skip to content

Commit

Permalink
Update to citeproc-js 1.1.80
Browse files Browse the repository at this point in the history
  • Loading branch information
dstillman committed Nov 5, 2017
1 parent 0bf546a commit 1617591
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions chrome/content/zotero/xpcom/citeproc.js
Expand Up @@ -24,7 +24,7 @@
*/

var CSL = {
PROCESSOR_VERSION: "1.1.178",
PROCESSOR_VERSION: "1.1.180",
CONDITION_LEVEL_TOP: 1,
CONDITION_LEVEL_BOTTOM: 2,
PLAIN_HYPHEN_REGEX: /(?:[^\\]-|\u2013)/,
Expand Down Expand Up @@ -4992,6 +4992,9 @@ CSL.Engine.prototype.processCitationCluster = function (citation, citationsPre,
}
var update_items = [];
for (var i = 0, ilen = citationByIndex.length; i < ilen; i += 1) {
if (!citationByIndex[i].properties) {
citationByIndex[i].properties = {};
}
citationByIndex[i].properties.index = i;
for (j = 0, jlen = citationByIndex[i].sortedItems.length; j < jlen; j += 1) {
item = citationByIndex[i].sortedItems[j];
Expand Down Expand Up @@ -13076,13 +13079,19 @@ CSL.Util.Names.doNormalize = function (state, namelist, terminator, mode) {
if (isAbbrev[i]) {
if (i < namelist.length - 2) {
namelist[i + 1] = "";
if ((!terminator || terminator.slice(-1) && terminator.slice(-1) !== " ")
&& namelist[i].length && namelist[i].match(CSL.ALL_ROMANESQUE_REGEXP)
&& (namelist[i].length > 1 || namelist[i + 2].length > 1)) {
var onlySpace = terminator.match(/^[\u0009\u000a\u000b\u000c\u000d\u0020\u00a0]+$/)
if (
onlySpace
|| (
(!terminator || (terminator.slice(-1) && !terminator.slice(-1).match(/[\u0009\u000a\u000b\u000c\u000d\u0020\u00a0]/)))
&& namelist[i].length && namelist[i].match(CSL.ALL_ROMANESQUE_REGEXP)
&& (namelist[i].length > 1 || namelist[i + 2].length > 1)
)
) {
namelist[i + 1] = " ";
}
if (namelist[i + 2].length > 1) {
namelist[i] = namelist[i] + terminator.replace(/[\u0009\u000a\u000b\u000c\u000d\u0020\ufeff\u00a0]+$/, "");
namelist[i] = namelist[i] + terminator.replace(/\ufeff$/, "");
} else {
namelist[i] = namelist[i] + terminator;
}
Expand Down

0 comments on commit 1617591

Please sign in to comment.