Skip to content

Commit 8bdaf6b

Browse files
committed
Merge branch 'main' of github.com:quarto-dev/quarto-cli into main
2 parents 722dc99 + cd62560 commit 8bdaf6b

File tree

5 files changed

+40
-3
lines changed

5 files changed

+40
-3
lines changed

src/core/jupyter/jupyter.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1367,7 +1367,7 @@ function mdOutputDisplayData(
13671367
lines[0] = lines[0].slice(1, -1);
13681368
return mdMarkdownOutput(lines);
13691369
} else {
1370-
return mdCodeOutput(lines);
1370+
return mdCodeOutput(lines.map(colors.stripColor));
13711371
}
13721372
}
13731373
}

src/execute/engine.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ export function fileEngineClaimReason(
157157

158158
export function fileExecutionEngine(
159159
file: string,
160+
markdown?: MappedString,
160161
) {
161162
// get the extension and validate that it can be handled by at least one of our engines
162163
const ext = extname(file).toLowerCase();
@@ -171,15 +172,19 @@ export function fileExecutionEngine(
171172
}
172173
}
173174

174-
return markdownExecutionEngine(Deno.readTextFileSync(file));
175+
// if we were passed a transformed markdown, use that for the text instead
176+
// of the contents of the file.
177+
return markdownExecutionEngine(
178+
markdown ? markdown.value : Deno.readTextFileSync(file),
179+
);
175180
}
176181

177182
export async function fileExecutionEngineAndTarget(
178183
file: string,
179184
quiet?: boolean,
180185
markdown?: MappedString,
181186
) {
182-
const engine = fileExecutionEngine(file);
187+
const engine = fileExecutionEngine(file, markdown);
183188
if (!engine) {
184189
throw new Error("Unable to render " + file);
185190
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
An inline r value `r 7 * 11 * 13`.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
title: "include inline test"
3+
format: html
4+
---
5+
6+
Here's an inline r through an include:
7+
8+
{{< include _includes-r-statements.qmd >}}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/*
2+
* include-engine-detection.test.ts
3+
*
4+
* Copyright (C) 2021 by RStudio, PBC
5+
*
6+
*/
7+
8+
import { fileLoader } from "../../utils.ts";
9+
import { ensureHtmlSelectorSatisfies } from "../../verify.ts";
10+
import { testRender } from "../render/render.ts";
11+
12+
const qmd = fileLoader("engine")("test-include-engine-detection.qmd", "html");
13+
testRender(qmd.input, "html", false, [
14+
ensureHtmlSelectorSatisfies(
15+
qmd.output.outputPath,
16+
"p",
17+
(nodelist) => {
18+
return Array.from(nodelist).map((x) => x.textContent).some((x) =>
19+
x.indexOf("1001") !== -1
20+
);
21+
},
22+
),
23+
]);

0 commit comments

Comments
 (0)