When porting a project from Bookdown, I found the following behavior surprising.

We are embedding code chunks in list items, for example:

```
#.  First item:

    ```{python}
    print("First item code")
    ```
```

When using `rmarkdown::render()`,  this executes and renders as I would expect with the rendered code output under the indented code block.

When rendering the same Rmd file in Quarto, the code executes correctly, but the rendered doc has lots of stray Markdown in it, such as:

~~~
::: {.cell indent=” “}

```{.python .cell-code}
print("First item code")
```

::: {.cell-output-stdout}
```
First item code
```
:::

:::
~~~

With Qmd format, the rendering does not interpret the in-list code blocks correctly, and leaves output like the following:

~~~
    First item:

    print(“First item code”) ```
~~~

The repo <https://github.com/matthew-brett/quarto-test/tree/main> has a MWE of Markdown, Rmd via Quarto, Rmd via `rmarkdown`, and Qmd format, generated with `make all`.

I am using the latest development version of Quarto, as of this evening.
2021-08-02T21:25:25Z
matthew-brett
closed
Puzzling difference in behavior of code chunks in lists
https://github.com/quarto-dev/quarto-cli/issues/74