Skip to content

Commit c8caa35

Browse files
committed
Lineage not working for patterns with pattern parameters
resolves #135
1 parent ed2dc9c commit c8caa35

File tree

3 files changed

+17
-16
lines changed

3 files changed

+17
-16
lines changed

builder/lineage_hunter.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@
2525
//strip out the template cruft
2626
var foundPattern = match.replace("{{> ", "").replace(" }}", "").replace("{{>", "").replace("}}", "");
2727

28+
// remove any potential pattern parameters. this and the above are rather brutish but I didn't want to do a regex at the time
29+
if(foundPattern.indexOf('(') > 0){
30+
foundPattern = foundPattern.substring(0, foundPattern.indexOf('('));
31+
}
32+
2833
//add if it doesnt exist
2934
if (pattern.lineageIndex.indexOf(foundPattern) === -1){
3035

builder/parameter_hunter.js

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
/*
2-
* patternlab-node - v0.10.0 - 2015
3-
*
1+
/*
2+
* patternlab-node - v0.10.0 - 2015
3+
*
44
* Brian Muenzenmeyer, and the web community.
5-
* Licensed under the MIT license.
6-
*
7-
* Many thanks to Brad Frost and Dave Olsen for inspiration, encouragement, and advice.
5+
* Licensed under the MIT license.
6+
*
7+
* Many thanks to Brad Frost and Dave Olsen for inspiration, encouragement, and advice.
88
*
99
*/
1010

@@ -40,7 +40,6 @@
4040
var paramData = eval(paramString);
4141

4242
//compile this partial immeadiately, essentially consuming it.
43-
//TODO: see how this affects lineage. perhaps add manually here.
4443
var partialPattern = pattern_assembler.get_pattern_by_key(partialName, patternlab);
4544
var existingData = pattern.data || patternlab.data;
4645

@@ -57,9 +56,6 @@
5756

5857
//remove the parameter from the partial and replace it with the rendered partial + paramData
5958
pattern.extendedTemplate = pattern.extendedTemplate.replace(pMatch, renderedPartial);
60-
61-
//TODO: lineage is missing for this pattern
62-
6359
});
6460
}
6561
}

builder/pattern_exporter.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
/*
2-
* patternlab-node - v0.10.0 - 2015
3-
*
1+
/*
2+
* patternlab-node - v0.10.0 - 2015
3+
*
44
* Brian Muenzenmeyer, and the web community.
5-
* Licensed under the MIT license.
6-
*
7-
* Many thanks to Brad Frost and Dave Olsen for inspiration, encouragement, and advice.
5+
* Licensed under the MIT license.
6+
*
7+
* Many thanks to Brad Frost and Dave Olsen for inspiration, encouragement, and advice.
88
*
99
*/
1010

0 commit comments

Comments
 (0)