@@ -20,11 +20,15 @@ function mermaid(type, value, format, meta) {
2020 var classes = attrs [ 1 ] ;
2121 var options = { width : '500' , format : 'png' , loc : 'inline' , theme : "default" , caption : "" } ;
2222 var configFile = path . join ( folder , ".mermaid-config.json" )
23-
2423 var confFileOpts = ""
2524 if ( fs . existsSync ( configFile ) ) {
2625 confFileOpts += " -c " + configFile
2726 }
27+ var puppeteerConfig = path . join ( folder , ".puppeteer.json" )
28+ var puppeteerOpts = ""
29+ if ( fs . existsSync ( puppeteerConfig ) ) {
30+ puppeteerOpts += " -p " + puppeteerConfig
31+ }
2832 var cssFile = path . join ( folder , ".mermaid.css" )
2933 if ( fs . existsSync ( cssFile ) ) {
3034 confFileOpts += " -C " + cssFile
@@ -49,7 +53,7 @@ function mermaid(type, value, format, meta) {
4953 // console.log(outdir);
5054 var savePath = tmpfileObj . name + "." + options . format
5155 var newPath = path . join ( outdir , `${ prefix } -${ counter } .${ options . format } ` ) ;
52- var fullCmd = `${ cmd } ${ confFileOpts } -w ${ options . width } -i ${ tmpfileObj . name } -t ${ options . theme } -o ${ savePath } `
56+ var fullCmd = `${ cmd } ${ confFileOpts } ${ puppeteerOpts } -w ${ options . width } -i ${ tmpfileObj . name } -t ${ options . theme } -o ${ savePath } `
5357 // console.log(fullCmd, savePath)
5458 exec ( fullCmd ) ;
5559 //console.log(oldPath, newPath);
0 commit comments