commit 16175912cafccbccd20e907a41884e55b1674346
parent 0bf546a0aa1f37abe3ff0ff0809e83cbe188fe91
Author: Dan Stillman <dstillman@zotero.org>
Date: Sun, 5 Nov 2017 02:23:27 -0500
Update to citeproc-js 1.1.80
Diffstat:
1 file changed, 14 insertions(+), 5 deletions(-)
diff --git a/chrome/content/zotero/xpcom/citeproc.js b/chrome/content/zotero/xpcom/citeproc.js
@@ -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)/,
@@ -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];
@@ -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;
}