Skip to content

Commit a52a346

Browse files
Merge pull request #675 from gergan/master
Fix the verbose partial closes #559
2 parents 812c234 + a3679e5 commit a52a346

File tree

4 files changed

+5
-3
lines changed

4 files changed

+5
-3
lines changed

core/lib/object_factory.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ var Pattern = function (relPath, data, patternlab) {
5959

6060
// Let's calculate the verbose name ahead of time! We don't use path.sep here
6161
// on purpose. This isn't a file name!
62-
this.verbosePartial = this.subdir + '/' + this.fileName;
62+
this.verbosePartial = this.subdir.split(path.sep).join('/') + '/' + this.fileName;
6363

6464
this.isPattern = true;
6565
this.isFlatPattern = this.patternGroup === this.patternSubGroup;

core/lib/pattern_assembler.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ var pattern_assembler = function () {
3434
for (var i = 0; i < patternlab.patterns.length; i++) {
3535
switch (partialName) {
3636
case patternlab.patterns[i].relPath:
37-
case patternlab.patterns[i].subdir + '/' + patternlab.patterns[i].fileName:
37+
case patternlab.patterns[i].verbosePartial:
3838
return patternlab.patterns[i];
3939
}
4040
}

core/lib/pattern_registry.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ PatternRegistry.prototype = {
6262
for (let thisPattern of patterns) {
6363
switch (partialName) {
6464
case thisPattern.relPath:
65-
case thisPattern.subdir + '/' + thisPattern.fileName:
65+
case thisPattern.verbosePartial:
6666
return thisPattern;
6767
}
6868
}

test/parameter_hunter_tests.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ function currentPatternClosure() {
1818
"relPath": "02-organisms/02-comments/01-sticky-comment.mustache",
1919
"fileName": "01-sticky-comment",
2020
"subdir": "02-organisms/02-comments",
21+
"verbosePartial": "02-organisms/02-comments/01-sticky-comment",
2122
"name": "02-organisms-02-comments-01-sticky-comment",
2223
"patternBaseName": "sticky-comment",
2324
"patternLink": "02-organisms-02-comments-01-sticky-comment/02-organisms-02-comments-01-sticky-comment.html",
@@ -41,6 +42,7 @@ function patternlabClosure() {
4142
"relPath": "01-molecules/06-components/02-single-comment.mustache",
4243
"fileName": "02-single-comment",
4344
"subdir": "01-molecules/06-components",
45+
"verbosePartial": "01-molecules/06-components/02-single-comment",
4446
"name": "01-molecules-06-components-02-single-comment",
4547
"patternBaseName": "single-comment",
4648
"patternLink": "01-molecules-06-components-02-single-comment/01-molecules-06-components-02-single-comment.html",

0 commit comments

Comments
 (0)