Skip to content

Commit

Permalink
Bump version, update CHANGES, bundle as 1.2.6
Browse files Browse the repository at this point in the history
  • Loading branch information
fbennett committed May 29, 2019
1 parent 184f15e commit 9892496
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 57 deletions.
7 changes: 7 additions & 0 deletions CHANGES.txt
@@ -1,5 +1,12 @@
Summary of changes to citeproc-js since version 1.2 release.

========================
Changes in version 1.2.6
========================

- Avoid potential type error when strip-periods is set
on cs:date-part

========================
Changes in version 1.2.5
========================
Expand Down
49 changes: 22 additions & 27 deletions citeproc.js
Expand Up @@ -23,7 +23,7 @@ Copyright (c) 2009-2019 Frank Bennett
<http://www.gnu.org/licenses/> respectively.
*/
var CSL = {
PROCESSOR_VERSION: "1.2.5",
PROCESSOR_VERSION: "1.2.6",
LOCATOR_LABELS_REGEXP: new RegExp("^((art|ch|subch|col|fig|l|n|no|op|p|pp|para|subpara|supp|pt|r|sec|subsec|sv|sch|tit|vrs|vol)\\.)\\s+(.*)"),
STATUTE_SUBDIV_PLAIN_REGEX: /(?:(?:^| )(?:art|bk|ch|subch|col|fig|fol|l|n|no|op|p|pp|para|subpara|supp|pt|r|sec|subsec|sv|sch|tit|vrs|vol)\. *)/,
STATUTE_SUBDIV_PLAIN_REGEX_FRONT: /(?:^\s*[.,;]*\s*(?:art|bk|ch|subch|col|fig|fol|l|n|no|op|p|pp|para|subpara|supp|pt|r|sec|subsec|sv|sch|tit|vrs|vol)\. *)/,
Expand Down Expand Up @@ -7228,6 +7228,25 @@ CSL.Node["date-part"] = {
}
state.build.date_parts.push(this.strings.name);
var date_variable = state.build.date_variables[0];
function formatAndStrip(myform, gender, val) {
if (!val) {
return val;
}
val = "" + CSL.Util.Dates[this.strings.name][myform](state, val, gender, this.default_locale);
if ("month" === this.strings.name) {
if (state.tmp.strip_periods) {
val = val.replace(/\./g, "");
} else {
for (var i = 0, ilen = this.decorations.length; i < ilen; i += 1) {
if ("@strip-periods" === this.decorations[i][0] && "true" === this.decorations[i][1]) {
val = val.replace(/\./g, "");
break;
}
}
}
}
return val;
}
func = function (state, Item) {
if (!state.tmp.date_object) {
return;
Expand Down Expand Up @@ -7301,32 +7320,8 @@ CSL.Node["date-part"] = {
myform = "numeric";
}
}
value = CSL.Util.Dates[this.strings.name][myform](state, value, gender, this.default_locale);
if ("month" === this.strings.name) {
if (state.tmp.strip_periods) {
value = value.replace(/\./g, "");
} else {
for (var i = 0, ilen = this.decorations.length; i < ilen; i += 1) {
if ("@strip-periods" === this.decorations[i][0] && "true" === this.decorations[i][1]) {
value = value.replace(/\./g, "");
break;
}
}
}
}
if (value_end) {
value_end = CSL.Util.Dates[this.strings.name][myform](state, value_end, gender, ("accessed" === date_variable), "_end");
if (state.tmp.strip_periods) {
value_end = value_end.replace(/\./g, "");
} else {
for (var i = 0, ilen = this.decorations.length; i < ilen; i += 1) {
if ("@strip-periods" === this.decorations[i][0] && "true" === this.decorations[i][1]) {
value_end = value_end.replace(/\./g, "");
break;
}
}
}
}
value = formatAndStrip.call(this, myform, gender, value);
value_end = formatAndStrip.call(this, myform, gender, value_end);
}
state.output.openLevel("empty");
if (state.tmp.date_collapse_at.length) {
Expand Down
49 changes: 22 additions & 27 deletions citeproc_commonjs.js
Expand Up @@ -23,7 +23,7 @@ Copyright (c) 2009-2019 Frank Bennett
<http://www.gnu.org/licenses/> respectively.
*/
var CSL = {
PROCESSOR_VERSION: "1.2.5",
PROCESSOR_VERSION: "1.2.6",
LOCATOR_LABELS_REGEXP: new RegExp("^((art|ch|subch|col|fig|l|n|no|op|p|pp|para|subpara|supp|pt|r|sec|subsec|sv|sch|tit|vrs|vol)\\.)\\s+(.*)"),
STATUTE_SUBDIV_PLAIN_REGEX: /(?:(?:^| )(?:art|bk|ch|subch|col|fig|fol|l|n|no|op|p|pp|para|subpara|supp|pt|r|sec|subsec|sv|sch|tit|vrs|vol)\. *)/,
STATUTE_SUBDIV_PLAIN_REGEX_FRONT: /(?:^\s*[.,;]*\s*(?:art|bk|ch|subch|col|fig|fol|l|n|no|op|p|pp|para|subpara|supp|pt|r|sec|subsec|sv|sch|tit|vrs|vol)\. *)/,
Expand Down Expand Up @@ -7228,6 +7228,25 @@ CSL.Node["date-part"] = {
}
state.build.date_parts.push(this.strings.name);
var date_variable = state.build.date_variables[0];
function formatAndStrip(myform, gender, val) {
if (!val) {
return val;
}
val = "" + CSL.Util.Dates[this.strings.name][myform](state, val, gender, this.default_locale);
if ("month" === this.strings.name) {
if (state.tmp.strip_periods) {
val = val.replace(/\./g, "");
} else {
for (var i = 0, ilen = this.decorations.length; i < ilen; i += 1) {
if ("@strip-periods" === this.decorations[i][0] && "true" === this.decorations[i][1]) {
val = val.replace(/\./g, "");
break;
}
}
}
}
return val;
}
func = function (state, Item) {
if (!state.tmp.date_object) {
return;
Expand Down Expand Up @@ -7301,32 +7320,8 @@ CSL.Node["date-part"] = {
myform = "numeric";
}
}
value = CSL.Util.Dates[this.strings.name][myform](state, value, gender, this.default_locale);
if ("month" === this.strings.name) {
if (state.tmp.strip_periods) {
value = value.replace(/\./g, "");
} else {
for (var i = 0, ilen = this.decorations.length; i < ilen; i += 1) {
if ("@strip-periods" === this.decorations[i][0] && "true" === this.decorations[i][1]) {
value = value.replace(/\./g, "");
break;
}
}
}
}
if (value_end) {
value_end = CSL.Util.Dates[this.strings.name][myform](state, value_end, gender, ("accessed" === date_variable), "_end");
if (state.tmp.strip_periods) {
value_end = value_end.replace(/\./g, "");
} else {
for (var i = 0, ilen = this.decorations.length; i < ilen; i += 1) {
if ("@strip-periods" === this.decorations[i][0] && "true" === this.decorations[i][1]) {
value_end = value_end.replace(/\./g, "");
break;
}
}
}
}
value = formatAndStrip.call(this, myform, gender, value);
value_end = formatAndStrip.call(this, myform, gender, value_end);
}
state.output.openLevel("empty");
if (state.tmp.date_collapse_at.length) {
Expand Down
4 changes: 2 additions & 2 deletions package.json
@@ -1,7 +1,7 @@
{
"name": "citeproc",
"version": "2.2.5",
"description": "The citeproc-js citation formatting module, in CommonJS format. This version is based on citeproc-js 1.2.5",
"version": "2.2.6",
"description": "The citeproc-js citation formatting module, in CommonJS format. This version is based on citeproc-js 1.2.6",
"main": "citeproc_commonjs.js",
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion src/load.js
Expand Up @@ -35,7 +35,7 @@

var CSL = {

PROCESSOR_VERSION: "1.2.5",
PROCESSOR_VERSION: "1.2.6",

LOCATOR_LABELS_REGEXP: new RegExp("^((art|ch|subch|col|fig|l|n|no|op|p|pp|para|subpara|supp|pt|r|sec|subsec|sv|sch|tit|vrs|vol)\\.)\\s+(.*)"),

Expand Down

0 comments on commit 9892496

Please sign in to comment.