-
Notifications
You must be signed in to change notification settings - Fork 346
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Indenting executable codeblocks makes them malfunction #9970
Comments
Unfortunately that's a limitation in our Jupyter setup. Code cells are not part of markdown; they're executed as separate cells in the .ipynb file, and so they need to be "top level". Yes, this is a bug, but it's a pretty foundational limitation that we won't be able to fix anytime soon. |
I honestly expected as much. Two small questions:
For reference, I'm pasting the relevant section of the resulting markdown: normal context
list context
There's a bunch of small differences |
The issue described here is only for
|
Interesting... I know we deal with indent in knitr, but it seems we don't correctly write the cell output div with no indent as they should be. Fenced div only works when no starting indent Just to clarify, the support for indented code cell for knitr engine is not a Quarto thing, this is a feature of knitr inherit by Quarto. Julia engine (from Quarto) does not seem to support it which is what I would have expected. |
Here is an update: for In 1.6 , another possibility consists in using the Since this is probably too expensive fix for to little gain, I'm guessing updating the docs to specify this is a limitation would be appropriate.
describing this behavior and the two possible fixes? |
Bug description
Normal markdown code supports nesting environments into one-another using indentation. For example, lists can be nested. Paragraphs can be nested into a list bullet-point. Also, indentation can be used to mark a verbatim block.
However, indenting executable code blocks makes them malfunction (for jupyter).
Steps to reproduce
This minimal example compiles to very weird markdown. The resulting html is weird. As far as I can tell, this is due to correct parsing of the weird markdown.
NB: this is a minimal example with a stupid output. The issue persists if using a
Markdown(tabulate(...))
example or a matplotlib figure.After compilation
Expected behavior
I'm not sure what the expected behavior should be, without breaking everything and making everything super complex.
For indentation outside of any context (first half of the example), I'm not sure if there is even any solution that makes sense:
For indentation inside of a list, like in the second half of the example, I would expect the behavior to be that indentation is preserved and produces correct markdown. I think the issue here is only that the markdown is mangled somehow.
Actual behavior
Your environment
Quarto check output
Quarto 1.5.45
[>] Checking versions of quarto binary dependencies...
Pandoc version 3.2.0: OK
Dart Sass version 1.70.0: OK
Deno version 1.41.0: OK
Typst version 0.11.0: OK
[>] Checking versions of quarto dependencies......OK
[>] Checking Quarto installation......OK
Version: 1.5.45
Path: C:\Users\Guillaume\AppData\Local\Programs\Quarto\bin
CodePage: 1252
[>] Checking tools....................OK
TinyTeX: (not installed)
Chromium: (not installed)
[>] Checking LaTeX....................OK
Tex: (not detected)
[>] Checking basic markdown render....OK
[>] Checking Python 3 installation....(None)
[>] Checking R installation...........(None)
PS D:\Desktop\Dojo\quarto_bug_report_listings>
I'm not sure why python is not seen but everything compiles as it should:
The text was updated successfully, but these errors were encountered: