Skip to content

Commit

Permalink
Fix particle-parsing bug
Browse files Browse the repository at this point in the history
  • Loading branch information
fbennett committed Feb 23, 2017
1 parent 75b155a commit 8c01fce
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
5 changes: 4 additions & 1 deletion src/load.js
Expand Up @@ -33,7 +33,7 @@

var CSL = {

PROCESSOR_VERSION: "1.1.155",
PROCESSOR_VERSION: "1.1.156",

CONDITION_LEVEL_TOP: 1,

Expand Down Expand Up @@ -516,6 +516,9 @@ var CSL = {
NOTE_FIELDS_REGEXP: /\{:(?:[\-_a-z]+|[A-Z]+):[^\}]+\}/g,
NOTE_FIELD_REGEXP: /^([\-_a-z]+|[A-Z]+):\s*([^\}]+)$/,

PARTICLE_GIVEN_REGEXP: /^([^ ]+(?:\u02bb |\u2019 | |\' ) *)(.+)$/,
PARTICLE_FAMILY_REGEXP: /^([^ ]+(?:\-|\u02bb|\u2019| |\') *)(.+)$/,

DISPLAY_CLASSES: ["block", "left-margin", "right-inline", "indent"],

NAME_VARIABLES: [
Expand Down
6 changes: 3 additions & 3 deletions src/util_name_particles.js
Expand Up @@ -254,13 +254,13 @@ CSL.parseParticles = function(){
nameValue = caseOverride ? nameValue.toLowerCase() : nameValue;
var particleList = [];
var apostrophe;
var rex;
if (firstNameFlag) {
apostrophe ="\u02bb";
nameValue = nameValue.split("").reverse().join("");
rex = CSL.PARTICLE_GIVEN_REGEXP;
} else {
apostrophe ="-\u2019";
rex = CSL.PARTICLE_FAMILY_REGEXP;
}
var rex = new RegExp("^([^ ]+[" + apostrophe + " \'] *)(.+)$");
var m = nameValue.match(rex);
while (m) {
var m1 = firstNameFlag ? m[1].split("").reverse().join("") : m[1];
Expand Down

0 comments on commit 8c01fce

Please sign in to comment.