-
Notifications
You must be signed in to change notification settings - Fork 406
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #509 from pattern-lab/fix-hidden-pattern-references
Fix hidden pattern references
- Loading branch information
Showing
13 changed files
with
125 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
test/files/_handlebars-test-patterns/00-atoms/00-global/_00-hidden.hbs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
I'm the hidden atom |
1 change: 1 addition & 0 deletions
1
test/files/_handlebars-test-patterns/00-molecules/00-global/00-hidden-pattern-tester.hbs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Here's the hidden atom: [{{> atoms-hidden}}] |
2 changes: 2 additions & 0 deletions
2
test/files/_patterns/00-test/15-hidden-pattern-tester.mustache
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
Hello there! | ||
Here's the hidden atom: [{{> test-hidden-pattern}}] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
This is the hidden atom |
1 change: 1 addition & 0 deletions
1
test/files/_underscore-test-patterns/00-atoms/00-global/_00-hidden.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
I'm the hidden atom |
1 change: 1 addition & 0 deletions
1
test/files/_underscore-test-patterns/00-molecules/00-global/00-hidden-pattern-tester.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Here's the hidden atom: [<%=_.renderNamedPartial('atoms-hidden', obj)%>] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
"use strict"; | ||
|
||
module.exports = { | ||
|
||
// fake pattern lab constructor: | ||
// sets up a fake patternlab object, which is needed by the pattern processing | ||
// apparatus. | ||
fakePatternLab: (testPatternsPath) => { | ||
var fpl = { | ||
partials: {}, | ||
patterns: [], | ||
footer: '', | ||
header: '', | ||
listitems: {}, | ||
listItemArray: [], | ||
data: { | ||
link: {} | ||
}, | ||
config: require('../../patternlab-config.json'), | ||
package: {} | ||
}; | ||
|
||
// patch the pattern source so the pattern assembler can correctly determine | ||
// the "subdir" | ||
fpl.config.paths.source.patterns = testPatternsPath; | ||
|
||
return fpl; | ||
}, | ||
|
||
/** | ||
* Strip out control characters from output if needed so make comparisons easier | ||
* @param output - the template to strip | ||
*/ | ||
sanitized: (outputTemplate) => { | ||
return outputTemplate.replace(/\n/g, ' ').replace(/\r/g, ' ').replace(/\s\s+/g, ' ').trim(); | ||
} | ||
}; |