Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions news/changelog-1.5.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ All changes included in 1.5:
- When searching for kernelspecs that match `python`, prefer one one that matches an active Python venv.
- ([#8454](https://github.com/quarto-dev/quarto-cli/issues/8454)): Allow Jupyter engine to handle markdown files with mixed-case extensions.
- ([#8919](https://github.com/quarto-dev/quarto-cli/issues/8919)): Ensure enough backticks in `quarto convert` from `.ipynb` to `.qmd` files.
- ([#8998](https://github.com/quarto-dev/quarto-cli/issues/8998)): Interpret slide separation markers `---` correctly when creating the `.ipynb` intermediate notebook from a `.qmd` file.

## Website Listings

Expand Down
10 changes: 8 additions & 2 deletions src/core/jupyter/jupyter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -427,9 +427,15 @@ export async function quartoMdToJupyter(
inCodeCell = false,
inCode = false,
backtickCount = 0;
for (const line of lines(inputContent)) {
let currentLine = 0;
const contentLines = lines(inputContent);
for (currentLine = 0; currentLine < contentLines.length; ++currentLine) {
const line = contentLines[currentLine];
// yaml front matter
if (yamlRegEx.test(line) && !inCodeCell && !inCode) {
if (
yamlRegEx.test(line) && !inCodeCell && !inCode &&
contentLines[currentLine + 1]?.trim() !== "" // https://github.com/quarto-dev/quarto-cli/issues/8998
) {
if (inYaml) {
lineBuffer.push(line);
flushLineBuffer("raw", !parsedFrontMatter);
Expand Down
25 changes: 25 additions & 0 deletions tests/docs/smoke-all/2024/03/22/8998.qmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
title: "Habits"
author: "John Doe"
format: revealjs
engine: jupyter
_quarto:
tests:
revealjs:
- []
- ["python"]
---

- Turn off alarm
- Get out of bed
- `{python} 1`

---

- Get in bed
- Count sheep
- `{python} 2`

---

Last slide to recreate the issue