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
Pandoc 2 changes the behavior of knitr chunk option indent for html_document #1557
Comments
I guess the behavior in Pandoc 2 is the way supposed to be.
Utilizing "special meaning" by
and output html preserving fences like below.
I guess Pandoc 1.x is outputing something like
If so, there is no way to use "special meaning" of indents. Would you check indents of fences? |
@atusy I'm not exactly sure what you are asking. Do you want to know how the backticks are indented in the Markdown file? This result has not changed between Pandoc 1 and 2. No matter which you use, the output Markdown file will have everything indented: the code chunk, the results it creates, and the backticks around each. See below. Is that what you wanted to know, or did you have another question? Pandoc 1
Pandoc 2
|
Yes, that's what I meant. It seems like a change in Pandoc 2.0.2
https://pandoc.org/releases.html#pandoc-2.0.2-12-november-2017 |
@atusy Thanks for investigating! It does appear that the change in the behavior of Since this change in behavior for processing indented code fences is documented in this thread and the main pandoc repository, hopefully this is sufficient explanation to anyone searching for this. |
This old thread has been automatically locked. If you think you have found something related to this, please open a new issue by following the issue guide (https://yihui.org/issue/), and link to this old issue if necessary. |
By filing an issue to this repo, I promise that
xfun::session_info('rmarkdown')
. I have upgraded all my packages to their latest versions (e.g., R, RStudio, and R packages), and also tried the development version:remotes::install_github('rstudio/rmarkdown')
.The hidden knitr chunk option
indent
behaves differently forhtml_document()
between pandoc 1 and 2. I realize this is a minor issue sinceindent
is only supposed to be used for markdown output. Also, it could be argued that the pandoc 2 behavior is preferred. But since I observed it, I wanted to share the result in case anyone depended on the pandoc 1 behavior.Reproducible Rmd file
The examples below use the following Rmd file, which I saved as
test-indent.Rmd
:pandoc 1 preserves the indentation in the HTML file
Rendering this document with pandoc 1.19.2.1 preserves the indentation in the HTML file:
which causes the code chunks to be malformed (screenshot below):
For conda users, I created this environment with the following command:
pandoc 2 removes the indentation in the HTML file
Rendering this document with pandoc 2.7.1 removes the indentation in the HTML file:
which causes the code chunks to properly formatted (screenshot below):
For conda users, I created this environment with the following command:
The text was updated successfully, but these errors were encountered: