Skip to content

Commit ce732fb

Browse files
committed
correct resolution of custom formats for project file renders
1 parent 1568bd6 commit ce732fb

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

src/command/preview/cmd.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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();

src/command/preview/preview.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff 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 () => {

0 commit comments

Comments
 (0)