This repository was archived by the owner on May 13, 2026. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ var markdown_parser = function () {
1111 //for each block process the yaml frontmatter and markdown
1212 var frontmatterRE = / - - - \r ? \n { 1 } ( [ \s \S ] * ) - - - \r ? \n { 1 } ( [ \s \S ] * ) + / gm;
1313 var chunks = frontmatterRE . exec ( block ) ;
14- if ( chunks && chunks [ 1 ] && chunks [ 2 ] ) {
14+ if ( chunks && chunks [ 1 ] ) {
1515
1616 //convert each yaml frontmatter key / value into an object key
1717 var frontmatter = chunks [ 1 ] ;
@@ -29,13 +29,19 @@ var markdown_parser = function () {
2929 }
3030
3131 }
32+ }
3233
34+ if ( chunks && chunks [ 2 ] ) {
3335 //parse the actual markdown
3436 returnObject . markdown = md . render ( chunks [ 2 ] ) ;
37+ } else {
38+ //assume the passed in block is raw markdown
39+ returnObject . markdown = md . render ( block ) ;
3540 }
3641 } catch ( ex ) {
3742 console . log ( ex ) ;
3843 console . log ( 'error parsing markdown block' , block ) ;
44+ return undefined ;
3945 }
4046
4147 //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 () {
174174 console . log ( 'found pattern-specific markdown for ' + currentPattern . patternPartial ) ;
175175 }
176176 }
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+ }
179183 }
180184 }
181185
Original file line number Diff line number Diff line change 11{
22 "name" : " patternlab-node" ,
33 "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 " ,
55 "main" : " ./core/lib/patternlab.js" ,
66 "dependencies" : {
77 "diveSync" : " ^0.3.0" ,
You can’t perform that action at this time.
0 commit comments