@@ -18,6 +18,7 @@ import {parseInfo} from "./info.js";
18
18
import { transformJavaScriptSync } from "./javascript/module.js" ;
19
19
import type { JavaScriptNode } from "./javascript/parse.js" ;
20
20
import { parseJavaScript } from "./javascript/parse.js" ;
21
+ import { withParams } from "./loader.js" ;
21
22
import { isAssetPath , relativePath } from "./path.js" ;
22
23
import { parsePlaceholder } from "./placeholder.js" ;
23
24
import type { Params } from "./route.js" ;
@@ -282,10 +283,19 @@ export async function parseMarkdown(input: string, options: ParseOptions): Promi
282
283
const root : Comment = roots . get ( fragment . id ) ;
283
284
const [ command , ...args ] = interpreters . get ( `.${ fragment . tag } ` ) ! ;
284
285
let target = "" ;
285
- const subprocess = spawn ( command , args , {
286
- windowsHide : true ,
287
- stdio : [ "pipe" , "pipe" , "inherit" ]
288
- } ) ;
286
+ const subprocess = spawn (
287
+ command ,
288
+ withParams (
289
+ command === "sh"
290
+ ? args . concat ( "-s" , "--" ) // TODO make this configurable
291
+ : args . concat ( "-" ) , // TODO make this configurable
292
+ params
293
+ ) ,
294
+ {
295
+ windowsHide : true ,
296
+ stdio : [ "pipe" , "pipe" , "inherit" ]
297
+ }
298
+ ) ;
289
299
subprocess . stdin . write ( fragment . source ) ;
290
300
subprocess . stdin . end ( ) ;
291
301
subprocess . stdout . on ( "data" , ( data ) => {
0 commit comments