Skip to content

Commit

Permalink
Bump version, update CHANGES, bundle
Browse files Browse the repository at this point in the history
  • Loading branch information
fbennett committed Jun 27, 2015
1 parent cf6c29c commit 4fe672e
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 27 deletions.
11 changes: 11 additions & 0 deletions CHANGES.txt
@@ -1,5 +1,16 @@
Summary of changes to citeproc-js since version 1.0.0 release.

=========================
Changes in version 1.1.33
=========================

- Fix bug in multiple layouts. With the second-field-align option,
the layout suffix on non-default alternative layouts was placed
outside of the right-inline block, resulting in a stray hard
return between the citation and the trailing punctuation in output.

Many thanks to Vladimir Sobolev for reporting the fault.

=========================
Changes in version 1.1.32
=========================
Expand Down
57 changes: 31 additions & 26 deletions citeproc.js
Expand Up @@ -10,7 +10,7 @@ if (!Array.indexOf) {
};
}
var CSL = {
PROCESSOR_VERSION: "1.1.32",
PROCESSOR_VERSION: "1.1.33",
CONDITION_LEVEL_TOP: 1,
CONDITION_LEVEL_BOTTOM: 2,
PLAIN_HYPHEN_REGEX: /(?:[^\\]-|\u2013)/,
Expand Down Expand Up @@ -2384,7 +2384,7 @@ CSL.Output.Queue.prototype.startTag = function (name, token) {
this.openLevel(name);
};
CSL.Output.Queue.prototype.endTag = function (name) {
this.closeLevel();
this.closeLevel(name);
this.popFormats();
};
CSL.Output.Queue.prototype.openLevel = function (token, ephemeral) {
Expand Down Expand Up @@ -4682,23 +4682,6 @@ CSL.getBibliographyEntries = function (bibsection) {
} else {
topblobs = this.output.queue[0].blobs[0].blobs;
}
for (j = topblobs.length - 1; j > -1; j += -1) {
if (topblobs[j].blobs && topblobs[j].blobs.length !== 0) {
var last_locale = this.tmp.cite_locales[this.tmp.cite_locales.length - 1];
var suffix;
if (this.tmp.cite_affixes[this.tmp.area][last_locale]) {
suffix = this.tmp.cite_affixes[this.tmp.area][last_locale].suffix;
} else {
suffix = this.bibliography.opt.layout_suffix;
}
chr = suffix.slice(0, 1);
if (chr && topblobs[j].strings.suffix.slice(-1) === chr) {
topblobs[j].strings.suffix = topblobs[j].strings.suffix.slice(0, -1);
}
topblobs[j].strings.suffix += suffix;
break;
}
}
topblobs[0].strings.prefix = this.bibliography.opt.layout_prefix + topblobs[0].strings.prefix;
}
for (var j=0,jlen=this.output.queue.length;j<jlen;j+=1) {
Expand Down Expand Up @@ -6225,6 +6208,31 @@ CSL.Node.label = {
CSL.Node.layout = {
build: function (state, target) {
var func, prefix_token, suffix_token, tok;
function setSuffix() {
if (state.build.area === "bibliography") {
suffix_token = new CSL.Token("text", CSL.SINGLETON);
func = function(state, Item, item) {
var last_locale = state.tmp.cite_locales[state.tmp.cite_locales.length - 1];
var suffix;
if (state.tmp.cite_affixes[state.tmp.area][state.tmp.last_cite_locale]) {
suffix = state.tmp.cite_affixes[state.tmp.area][state.tmp.last_cite_locale].suffix;
} else {
suffix = state.bibliography.opt.layout_suffix;
}
var chr = suffix.slice(0, 1);
var topblobs = state.output.current.value().blobs;
if (chr && topblobs[topblobs.length-1].strings.suffix.slice(-1) === chr) {
topblobs[topblobs.length-1].strings.suffix = topblobs[topblobs.length-1].strings.suffix.slice(0, -1);
}
topblobs[topblobs.length-1].strings.suffix += suffix;
if (state.bibliography.opt["second-field-align"]) {
state.output.endTag("bib_other");
}
};
suffix_token.execs.push(func);
target.push(suffix_token);
}
}
if (this.tokentype === CSL.START) {
if (this.locale_raw) {
state.build.current_default_locale = this.locale_raw;
Expand Down Expand Up @@ -6355,6 +6363,7 @@ CSL.Node.layout = {
}
if (this.tokentype === CSL.END) {
if (this.locale_raw) {
setSuffix();
if (!state.build.layout_locale_flag) {
my_tok.name = "if";
my_tok.tokentype = CSL.END;
Expand All @@ -6369,6 +6378,7 @@ CSL.Node.layout = {
}
}
if (!this.locale_raw) {
setSuffix();
if (state.tmp.cite_affixes[state.build.area]) {
if (state.build.layout_locale_flag) {
tok = new CSL.Token("else", CSL.END);
Expand All @@ -6395,12 +6405,7 @@ CSL.Node.layout = {
target.push(suffix_token);
}
func = function (state, Item) {
if (state.tmp.area === "bibliography") {
if (state.bibliography.opt["second-field-align"]) {
state.output.endTag();
}
}
state.output.closeLevel();
state.output.closeLevel("empty");
};
this.execs.push(func);
func = function (state, Item) {
Expand Down Expand Up @@ -12004,7 +12009,7 @@ CSL.Util.substituteEnd = function (state, target) {
bib_first_end = new CSL.Token("group", CSL.END);
func = function (state, Item) {
if (!state.tmp.render_seen) {
state.output.endTag(); // closes bib_first
state.output.endTag("bib_first"); // closes bib_first
}
};
bib_first_end.execs.push(func);
Expand Down
2 changes: 1 addition & 1 deletion src/load.js
Expand Up @@ -45,7 +45,7 @@ if (!Array.indexOf) {

var CSL = {

PROCESSOR_VERSION: "1.1.32",
PROCESSOR_VERSION: "1.1.33",

CONDITION_LEVEL_TOP: 1,

Expand Down

0 comments on commit 4fe672e

Please sign in to comment.