Open ryanzomorrodi opened 3 months ago
I can reproduce on 73b59b3f1e6c4278073197e02394ea1f128adfe0. Thanks for the report.
text following the list is interpreted as code
Note that this is because the diagram breaks the list, so the text is taken outside of the list. In Markdown, an indented text means that it is code block. You can see this in GitHub where indented text gets read as code block.
Makes sense. I was uncertain as to what was causing the issue, because it didn't occur with R or python chunks like below
---
title: "no error"
format: html
---
1. List item
a. list item
```{r}
plot(x = 1:4, y = 1:4)
Look at this graph
b. List item
That's because they are not evaluated the same way (same code path) as diagrams are unrelated to computation/engine.
We also don't support these declarations anywhere beside the top level of the document. The fact that it more-or-less works is an accident. We should have a warning about this. I'll add to the linter epic.
In the case of knitr
, indented code cell is supported so yes it is an "accident" on Quarto side.
Quarto doesn't support it in general because Jupyter code cells are not part of Markdown; they're top-level elements at the notebook, and so Quarto takes the approach that every executable code cell needs to be in the top level. This is admittedly unfortunate in the case of diagrams.
Bug description
When using graphviz or mermaid within a list, the output graph is not indented at all and the text following the list is interpreted as code
See below image:
Steps to reproduce