@@ -65,7 +65,7 @@ import {
6565 QuartoFilterEntryPointQualifiedFull ,
6666} from "../../config/types.ts" ;
6767import { QuartoFilterSpec } from "./types.ts" ;
68- import { Metadata } from "../../config/types.ts" ;
68+ import { Metadata , QualifiedPath } from "../../config/types.ts" ;
6969import { kProjectType } from "../../project/types.ts" ;
7070import { bibEngine } from "../../config/pdf.ts" ;
7171import { rBinaryPath , resourcePath } from "../../core/resources.ts" ;
@@ -772,7 +772,7 @@ export async function resolveFilters(
772772 return filter . path ;
773773 case "relative" :
774774 return resolve ( dirname ( options . source ) , filter . path ) ;
775- case "project" :
775+ case "project-relative " :
776776 return resolve ( join ( options . project . dir , filter . path ) ) ;
777777 }
778778 } ;
@@ -891,13 +891,18 @@ async function resolveFilterExtension(
891891 return { type : filter } ;
892892 }
893893 if ( typeof filter !== "string" ) {
894- const fileType : "project" | "relative" = filter . path . startsWith ( "/" )
895- ? "project"
896- : "relative" ;
897- const path = {
898- type : fileType ,
899- path : filter . path ,
900- } ;
894+ const path : QualifiedPath = ( ( ) => {
895+ if ( typeof filter . path !== "string" ) {
896+ const result = filter . path ;
897+ return result ;
898+ }
899+ const fileType : "project-relative" | "relative" =
900+ filter . path . startsWith ( "/" ) ? "project-relative" : "relative" ;
901+ return {
902+ type : fileType ,
903+ path : filter . path ,
904+ } ;
905+ } ) ( ) ;
901906 // deno-lint-ignore no-explicit-any
902907 if ( ( filter as any ) . at ) {
903908 const entryPoint = filter as QuartoFilterEntryPoint ;
@@ -939,8 +944,8 @@ async function resolveFilterExtension(
939944 const filterType : "json" | "lua" = extname ( filter ) !== ".lua"
940945 ? "json"
941946 : "lua" ;
942- const pathType : "project" | "relative" = filter . startsWith ( "/" )
943- ? "project"
947+ const pathType : "project-relative " | "relative" = filter . startsWith ( "/" )
948+ ? "project-relative "
944949 : "relative" ;
945950
946951 return {
@@ -999,15 +1004,21 @@ async function resolveFilterExtension(
9991004 } ,
10001005 } ;
10011006 }
1002-
1007+ if ( typeof f . path === "string" ) {
1008+ return {
1009+ ...f ,
1010+ // deno-lint-ignore no-explicit-any
1011+ at : ( f as any ) . at ?? "__quarto-auto" ,
1012+ path : {
1013+ type : "absolute" ,
1014+ path : f . path ,
1015+ } ,
1016+ } ;
1017+ }
10031018 return {
10041019 ...f ,
1005- // deno-lint-ignore no-explicit-any
10061020 at : ( f as any ) . at ?? "__quarto-auto" ,
1007- path : {
1008- type : "absolute" ,
1009- path : f . path ,
1010- } ,
1021+ path : f . path ,
10111022 } ;
10121023 } ) ;
10131024 } ;
0 commit comments