File tree Expand file tree Collapse file tree 3 files changed +14
-4
lines changed Expand file tree Collapse file tree 3 files changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ var markdown_parser = function () {
11
11
//for each block process the yaml frontmatter and markdown
12
12
var frontmatterRE = / - - - \r ? \n { 1 } ( [ \s \S ] * ) - - - \r ? \n { 1 } ( [ \s \S ] * ) + / gm;
13
13
var chunks = frontmatterRE . exec ( block ) ;
14
- if ( chunks && chunks [ 1 ] && chunks [ 2 ] ) {
14
+ if ( chunks && chunks [ 1 ] ) {
15
15
16
16
//convert each yaml frontmatter key / value into an object key
17
17
var frontmatter = chunks [ 1 ] ;
@@ -29,13 +29,19 @@ var markdown_parser = function () {
29
29
}
30
30
31
31
}
32
+ }
32
33
34
+ if ( chunks && chunks [ 2 ] ) {
33
35
//parse the actual markdown
34
36
returnObject . markdown = md . render ( chunks [ 2 ] ) ;
37
+ } else {
38
+ //assume the passed in block is raw markdown
39
+ returnObject . markdown = md . render ( block ) ;
35
40
}
36
41
} catch ( ex ) {
37
42
console . log ( ex ) ;
38
43
console . log ( 'error parsing markdown block' , block ) ;
44
+ return undefined ;
39
45
}
40
46
41
47
//return the frontmatter keys and markdown for a consumer to decide what to do with
Original file line number Diff line number Diff line change @@ -174,8 +174,12 @@ var pattern_assembler = function () {
174
174
console . log ( 'found pattern-specific markdown for ' + currentPattern . patternPartial ) ;
175
175
}
176
176
}
177
- catch ( e ) {
178
- // do nothing
177
+ catch ( err ) {
178
+ // do nothing when file not found
179
+ if ( err . errno !== - 4058 ) {
180
+ console . log ( 'there was an error setting pattern keys after markdown parsing of the companion file for pattern ' + currentPattern . patternPartial ) ;
181
+ console . log ( err ) ;
182
+ }
179
183
}
180
184
}
181
185
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " patternlab-node" ,
3
3
"description" : " Pattern Lab is a collection of tools to help you create atomic design systems. This is the node command line interface (CLI)." ,
4
- "version" : " 2.1.0 " ,
4
+ "version" : " 2.1.1 " ,
5
5
"main" : " ./core/lib/patternlab.js" ,
6
6
"dependencies" : {
7
7
"diveSync" : " ^0.3.0" ,
You can’t perform that action at this time.
0 commit comments