Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Improve parsing of brother name. #242

Merged
merged 1 commit into from

1 participant

@ceoaliongroo
Collaborator
@ceoaliongroo ceoaliongroo merged commit 49506a8 into from
@ceoaliongroo ceoaliongroo deleted the branch
@ceoaliongroo
Collaborator

Merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Feb 27, 2014
  1. @ceoaliongroo
This page is out of date. Refresh to see the latest.
Showing with 14 additions and 2 deletions.
  1. +14 −2 Gruntfile.js
View
16 Gruntfile.js
@@ -905,12 +905,24 @@ module.exports = function (grunt) {
if (child.node.type !== 'chronological' && !child.node.hasChronologicalChildren) {
child.node.brothers = _.filter(setSiblingsInfo(childs), function(brother) {
// Clean the name property.
- var label;
+ var label = undefined;
brother._name = brother.name;
brother.name = he.decode(brother.name);
- brother.name = (label = brother.name.match(/[:\d+:|:_:]+ (.*)/)) ? label.pop() : brother.name;
+ brother.result = brother.name.match(/^:\d+: (.*)|^:_: (.*)/);
+ if (brother.result) {
+ brother._result = [];
+ brother.result.forEach(function(item) {
+ if (typeof item !== 'undefined') {
+ brother._result.push(item);
+ }
+ });
+ brother._result = new Array(brother._result);
+ label = brother._result.pop();
+ }
+
+ brother.name = (label) ? label.pop() : brother.name;
return brother.guid !== child.node.guid && !brother._name.match(/:\d+:/);
});
Something went wrong with that request. Please try again.