Skip to content

Commit 7c0e332

Browse files
cross-platform filtering of bundled extension metadata
fixes #13819
1 parent e2cacd8 commit 7c0e332

File tree

2 files changed

+19
-4
lines changed

2 files changed

+19
-4
lines changed

src/command/render/pandoc.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,9 @@ export async function runPandoc(
435435
const filteredEngines = metadata.engines.filter((engine) => {
436436
const enginePath = typeof engine === "string" ? engine : engine.path;
437437
// Keep user engines, filter out bundled ones
438-
return !enginePath?.includes("/src/resources/extension-subtrees/");
438+
return !enginePath?.replace(/\\/g, "/").includes(
439+
"resources/extension-subtrees/",
440+
);
439441
});
440442

441443
// Remove the engines key entirely if empty, otherwise assign filtered array
@@ -1314,9 +1316,9 @@ export async function runPandoc(
13141316
const filteredEngines = pandocPassedMetadata.engines.filter((engine) => {
13151317
const enginePath = typeof engine === "string" ? engine : engine.path;
13161318
if (!enginePath) return true;
1317-
1318-
const normalizedPath = enginePath.replace(/\\/g, "/");
1319-
return !normalizedPath.includes("extension-subtrees/");
1319+
return !enginePath.replace(/\\/g, "/").includes(
1320+
"resources/extension-subtrees/",
1321+
);
13201322
});
13211323

13221324
if (filteredEngines.length === 0) {
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
title: Basic doc
3+
format: html
4+
_quarto:
5+
tests:
6+
html:
7+
printsMessage:
8+
level: INFO
9+
regex: 'resources[/\\]extension-subtrees[/\\]'
10+
negate: true
11+
---
12+
13+
It should be markdown engine.

0 commit comments

Comments
 (0)