Update citeproc-js to 1.1.133
This commit is contained in:
parent
610dce7c1f
commit
015a13716f
1 changed files with 39 additions and 34 deletions
|
@ -23,7 +23,7 @@
|
||||||
* <http://www.gnu.org/licenses/> respectively.
|
* <http://www.gnu.org/licenses/> respectively.
|
||||||
*/
|
*/
|
||||||
var CSL = {
|
var CSL = {
|
||||||
PROCESSOR_VERSION: "1.1.131",
|
PROCESSOR_VERSION: "1.1.133",
|
||||||
CONDITION_LEVEL_TOP: 1,
|
CONDITION_LEVEL_TOP: 1,
|
||||||
CONDITION_LEVEL_BOTTOM: 2,
|
CONDITION_LEVEL_BOTTOM: 2,
|
||||||
PLAIN_HYPHEN_REGEX: /(?:[^\\]-|\u2013)/,
|
PLAIN_HYPHEN_REGEX: /(?:[^\\]-|\u2013)/,
|
||||||
|
@ -238,19 +238,23 @@ var CSL = {
|
||||||
elems.push(m[i]);
|
elems.push(m[i]);
|
||||||
}
|
}
|
||||||
elems.push(splt[splt.length-1])
|
elems.push(splt[splt.length-1])
|
||||||
|
for (var i=1,ilen=elems.length;i<ilen;i += 2) {
|
||||||
|
elems[i] = '\n' + elems[i].slice(2,-1).trim() + '\n';
|
||||||
|
}
|
||||||
|
elems = elems.join('').split('\n');
|
||||||
|
} else {
|
||||||
|
elems = Item.note.split('\n');
|
||||||
|
}
|
||||||
var names = {};
|
var names = {};
|
||||||
for (var i=1,ilen=elems.length;i<ilen;i+=2) {
|
for (var i=0,ilen=elems.length;i<ilen;i++) {
|
||||||
var mm = elems[i].match(CSL.NOTE_FIELD_REGEXP);
|
var line = elems[i];
|
||||||
|
var mm = line.match(CSL.NOTE_FIELD_REGEXP);
|
||||||
|
if (!mm) continue;
|
||||||
var key = mm[1];
|
var key = mm[1];
|
||||||
var val = mm[2].replace(/^\s+/, "").replace(/\s+$/, "");
|
var val = mm[2].replace(/^\s+/, "").replace(/\s+$/, "");
|
||||||
if (!Item[key]) {
|
if (!Item[key]) {
|
||||||
if (!validFieldsForType || validFieldsForType[key]) {
|
|
||||||
if (CSL.DATE_VARIABLES.indexOf(key) > -1) {
|
if (CSL.DATE_VARIABLES.indexOf(key) > -1) {
|
||||||
Item[key] = {raw: val};
|
Item[key] = {raw: val};
|
||||||
elems[i] = "";
|
|
||||||
} else {
|
|
||||||
Item[key] = val;
|
|
||||||
}
|
|
||||||
} else if (CSL.NAME_VARIABLES.indexOf(key) > -1) {
|
} else if (CSL.NAME_VARIABLES.indexOf(key) > -1) {
|
||||||
if (!names[key]) {
|
if (!names[key]) {
|
||||||
names[key] = [];
|
names[key] = [];
|
||||||
|
@ -263,8 +267,10 @@ var CSL = {
|
||||||
CSL.parseParticles(name);
|
CSL.parseParticles(name);
|
||||||
names[key].push(name);
|
names[key].push(name);
|
||||||
}
|
}
|
||||||
elems[i] = "";
|
} else {
|
||||||
|
Item[key] = val;
|
||||||
}
|
}
|
||||||
|
elems[i] = "";
|
||||||
}
|
}
|
||||||
if (name === "type") {
|
if (name === "type") {
|
||||||
Item.type = val;
|
Item.type = val;
|
||||||
|
@ -274,7 +280,6 @@ var CSL = {
|
||||||
for (var key in names) {
|
for (var key in names) {
|
||||||
Item[key] = names[key];
|
Item[key] = names[key];
|
||||||
}
|
}
|
||||||
}
|
|
||||||
},
|
},
|
||||||
GENDERS: ["masculine", "feminine"],
|
GENDERS: ["masculine", "feminine"],
|
||||||
ERROR_NO_RENDERED_FORM: 1,
|
ERROR_NO_RENDERED_FORM: 1,
|
||||||
|
@ -365,7 +370,7 @@ var CSL = {
|
||||||
VIETNAMESE_SPECIALS: /[\u00c0-\u00c3\u00c8-\u00ca\u00cc\u00cd\u00d2-\u00d5\u00d9\u00da\u00dd\u00e0-\u00e3\u00e8-\u00ea\u00ec\u00ed\u00f2-\u00f5\u00f9\u00fa\u00fd\u0101\u0103\u0110\u0111\u0128\u0129\u0168\u0169\u01a0\u01a1\u01af\u01b0\u1ea0-\u1ef9]/,
|
VIETNAMESE_SPECIALS: /[\u00c0-\u00c3\u00c8-\u00ca\u00cc\u00cd\u00d2-\u00d5\u00d9\u00da\u00dd\u00e0-\u00e3\u00e8-\u00ea\u00ec\u00ed\u00f2-\u00f5\u00f9\u00fa\u00fd\u0101\u0103\u0110\u0111\u0128\u0129\u0168\u0169\u01a0\u01a1\u01af\u01b0\u1ea0-\u1ef9]/,
|
||||||
VIETNAMESE_NAMES: /^(?:(?:[.AaBbCcDdEeGgHhIiKkLlMmNnOoPpQqRrSsTtUuVvXxYy \u00c0-\u00c3\u00c8-\u00ca\u00cc\u00cd\u00d2-\u00d5\u00d9\u00da\u00dd\u00e0-\u00e3\u00e8-\u00ea\u00ec\u00ed\u00f2-\u00f5\u00f9\u00fa\u00fd\u0101\u0103\u0110\u0111\u0128\u0129\u0168\u0169\u01a0\u01a1\u01af\u01b0\u1ea0-\u1ef9]{2,6})(\s+|$))+$/,
|
VIETNAMESE_NAMES: /^(?:(?:[.AaBbCcDdEeGgHhIiKkLlMmNnOoPpQqRrSsTtUuVvXxYy \u00c0-\u00c3\u00c8-\u00ca\u00cc\u00cd\u00d2-\u00d5\u00d9\u00da\u00dd\u00e0-\u00e3\u00e8-\u00ea\u00ec\u00ed\u00f2-\u00f5\u00f9\u00fa\u00fd\u0101\u0103\u0110\u0111\u0128\u0129\u0168\u0169\u01a0\u01a1\u01af\u01b0\u1ea0-\u1ef9]{2,6})(\s+|$))+$/,
|
||||||
NOTE_FIELDS_REGEXP: /\{:(?:[\-_a-z]+|[A-Z]+):[^\}]+\}/g,
|
NOTE_FIELDS_REGEXP: /\{:(?:[\-_a-z]+|[A-Z]+):[^\}]+\}/g,
|
||||||
NOTE_FIELD_REGEXP: /\{:([\-_a-z]+|[A-Z]+):\s*([^\}]+)\}/,
|
NOTE_FIELD_REGEXP: /^([\-_a-z]+|[A-Z]+):\s*([^\}]+)$/,
|
||||||
DISPLAY_CLASSES: ["block", "left-margin", "right-inline", "indent"],
|
DISPLAY_CLASSES: ["block", "left-margin", "right-inline", "indent"],
|
||||||
NAME_VARIABLES: [
|
NAME_VARIABLES: [
|
||||||
"author",
|
"author",
|
||||||
|
|
Loading…
Reference in a new issue