Skip to content

Commit

Permalink
Update citeproc-js to 1.1.167
Browse files Browse the repository at this point in the history
  • Loading branch information
dstillman committed May 19, 2017
1 parent 74fe4b3 commit cf12543
Showing 1 changed file with 18 additions and 5 deletions.
23 changes: 18 additions & 5 deletions chrome/content/zotero/xpcom/citeproc.js
Expand Up @@ -23,7 +23,7 @@
* <http://www.gnu.org/licenses/> respectively.
*/
var CSL = {
PROCESSOR_VERSION: "1.1.165",
PROCESSOR_VERSION: "1.1.167",
CONDITION_LEVEL_TOP: 1,
CONDITION_LEVEL_BOTTOM: 2,
PLAIN_HYPHEN_REGEX: /(?:[^\\]-|\u2013)/,
Expand Down Expand Up @@ -3796,6 +3796,10 @@ CSL.Output.Queue.prototype.append = function (str, tokname, notSerious, ignorePr
this.state.parallel.AppendBlobPointer(curr);
}
if ("string" === typeof str) {
if ("string" === typeof blob.blobs && [':', '!', '?', '.', ',', ';'].indexOf(blob.blobs.slice(0, 1)) > -1) {
blob.strings.prefix = blob.strings.prefix + blob.blobs.slice(0, 1);
blob.blobs = blob.blobs.slice(1);
}
if (blob.strings["text-case"]) {
blob.blobs = CSL.Output.Formatters[blob.strings["text-case"]](this.state, str);
}
Expand Down Expand Up @@ -14689,7 +14693,7 @@ CSL.Util.FlipFlopper = function(state) {
}
return false;
}
function _undoppelToQueue(blob, doppel) {
function _undoppelToQueue(blob, doppel, leadingSpace) {
var TOP = blob;
var firstString = true;
var tagReg = new _TagReg(blob);
Expand Down Expand Up @@ -14767,7 +14771,11 @@ CSL.Util.FlipFlopper = function(state) {
};
var stack = new Stack(blob);
if (doppel.strings.length) {
stack.addStyling(doppel.strings[0]);
var str = doppel.strings[0];
if (leadingSpace) {
str = " " + str;
}
stack.addStyling(str);
}
for (var i=0,ilen=doppel.tags.length;i<ilen;i++) {
var tag = doppel.tags[i];
Expand All @@ -14783,7 +14791,12 @@ CSL.Util.FlipFlopper = function(state) {
}
}
function processTags(blob) {
var str = " " + blob.blobs;
var str = blob.blobs;
var leadingSpace = false;
if (str.slice(0, 1) === " " && !str.match(/^\s+[\'\"]/)) {
leadingSpace = true;
}
var str = " " + str;
var doppel = _doppelString(str);
if (doppel.tags.length === 0) return;
var quoteFormSeen = false;
Expand Down Expand Up @@ -14862,7 +14875,7 @@ CSL.Util.FlipFlopper = function(state) {
doppel.strings[i] += tag.slice(0, 1);
}
}
_undoppelToQueue(blob, doppel);
_undoppelToQueue(blob, doppel, leadingSpace);
}
}
CSL.Output.Formatters = new function () {
Expand Down

0 comments on commit cf12543

Please sign in to comment.