File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -235,7 +235,7 @@ export const previewCommand = new Command()
235235 if ( Deno . statSync ( file ) . isFile ) {
236236 const project = await projectContext ( file ) ;
237237 if ( project && projectIsWebsite ( project ) ) {
238- const format = await previewFormat ( file , flags . to ) ;
238+ const format = await previewFormat ( file , flags . to , project ) ;
239239 if ( isHtmlOutput ( format , true ) ) {
240240 setPreviewFormat ( format , flags , args ) ;
241241 const services = renderServices ( ) ;
Original file line number Diff line number Diff line change @@ -95,14 +95,14 @@ export async function preview(
9595 pandocArgs : string [ ] ,
9696 options : PreviewOptions ,
9797) {
98+ // see if this is project file
99+ const project = await projectContext ( file ) ;
100+
98101 // determine the target format if there isn't one in the command line args
99102 // (current we force the use of an html or pdf based format)
100- const format = await previewFormat ( file , flags . to ) ;
103+ const format = await previewFormat ( file , flags . to , project ) ;
101104 setPreviewFormat ( format , flags , pandocArgs ) ;
102105
103- // see if this is project file
104- const project = await projectContext ( file ) ;
105-
106106 // render for preview (create function we can pass to watcher then call it)
107107 let isRendering = false ;
108108 const render = async ( ) => {
You can’t perform that action at this time.
0 commit comments