|
1 | | -/* |
2 | | - * patternlab-node - v0.15.0 - 2015 |
3 | | - * |
| 1 | +/* |
| 2 | + * patternlab-node - v0.15.1 - 2015 |
| 3 | + * |
4 | 4 | * 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. |
8 | 8 | * |
9 | 9 | */ |
10 | 10 |
|
|
24 | 24 |
|
25 | 25 | // returns any patterns that match {{> value:mod }} or {{> value:mod(foo:"bar") }} within the pattern |
26 | 26 | function findPartialsWithStyleModifiers(pattern){ |
27 | | - var matches = pattern.template.match(/{{>([ ])?([\w\-\.\/~]+)(?!\()(\:[A-Za-z0-9-_]+)+(?:(| )\(.*)?([ ])?}}/g); |
| 27 | + var matches = pattern.template.match(/{{>([ ])?([\w\-\.\/~]+)(?!\()(\:[A-Za-z0-9-_|]+)+(?:(| )\(.*)?([ ])?}}/g); |
28 | 28 | return matches; |
29 | 29 | } |
30 | 30 |
|
31 | 31 | // returns any patterns that match {{> value(foo:"bar") }} or {{> value:mod(foo:"bar") }} within the pattern |
32 | 32 | function findPartialsWithPatternParameters(pattern){ |
33 | | - var matches = pattern.template.match(/{{>([ ])?([\w\-\.\/~]+)(?:\:[A-Za-z0-9-_]+)?(?:(| )\(.*)+([ ])?}}/g); |
| 33 | + var matches = pattern.template.match(/{{>([ ])?([\w\-\.\/~]+)(?:\:[A-Za-z0-9-_|]+)?(?:(| )\(.*)+([ ])?}}/g); |
34 | 34 | return matches; |
35 | 35 | } |
36 | 36 |
|
37 | 37 | //find and return any {{> template-name* }} within pattern |
38 | 38 | function findPartials(pattern){ |
39 | | - var matches = pattern.template.match(/{{>([ ])?([\w\-\.\/~]+)(?:\:[A-Za-z0-9-_]+)?(?:(| )\(.*)?([ ])?}}/g); |
| 39 | + var matches = pattern.template.match(/{{>([ ])?([\w\-\.\/~]+)(?:\:[A-Za-z0-9-_|]+)?(?:(| )\(.*)?([ ])?}}/g); |
40 | 40 | return matches; |
41 | 41 | } |
42 | 42 |
|
|
207 | 207 |
|
208 | 208 | //do something with the regular old partials |
209 | 209 | for(i = 0; i < foundPatternPartials.length; i++){ |
210 | | - var partialKey = foundPatternPartials[i].replace(/{{>([ ])?([\w\-\.\/~]+)(:[A-z-_]+)?(?:\:[A-Za-z0-9-]+)?(?:(| )\(.*)?([ ])?}}/g, '$2'); |
| 210 | + var partialKey = foundPatternPartials[i].replace(/{{>([ ])?([\w\-\.\/~]+)(:[A-z-_|]+)?(?:\:[A-Za-z0-9-_]+)?(?:(| )\(.*)?([ ])?}}/g, '$2'); |
211 | 211 |
|
212 | 212 | var partialPath; |
213 | 213 |
|
|
262 | 262 | throw 'Could not find pattern with key ' + key; |
263 | 263 | } |
264 | 264 |
|
265 | | - |
| 265 | + |
266 | 266 | function mergeData(obj1, obj2){ |
267 | 267 | if(typeof obj2 === 'undefined'){ |
268 | 268 | obj2 = {}; |
|
0 commit comments