-
Notifications
You must be signed in to change notification settings - Fork 80
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
Code/output blocks are split #463
Comments
This is an issue with knitr, it seems we missed a breakage for the collapse options With knitr 1.46 > xfun::raw_string(knitr::knit(text = c("```{r, collapse=TRUE}\n1 + 1\n1:1\n```")))
``` r
1 + 1
## [1] 2
```
``` r
1:1
## [1] 1
``` With knitr 1.45 > xfun::raw_string(knitr::knit(text = c("```{r, collapse=TRUE}\n1 + 1\n1:1\n```")))
```r
1 + 1
## [1] 2
1:1
## [1] 1
``` I'll fix it on knitr side. |
Thanks @cderv for tracking this down. I will close here and just wait for the fix to appear in a released version of knitr. |
I'm seeing this problem again in knitr 1.47:
|
It is fixed in current knitr dev version, which will be knitr 1.48. It has not been released to CRAN yet. @yihui could you do a knitr release so that this is solved for reprex ? |
Can people wait for two more weeks? I've been exhausted recently. If there's a hurry, I can certainly make the release sooner, but CRAN just complained to me about my last release, so I tend not to make the next release too soon. |
Yeah, no rush from my end. |
Running the following in a bare R console:
gives:
Created on 2024-05-29 with reprex v2.1.0.9000
Session info
Before, {reprex} would keep code and output together in one block. More recently though, R version and rmarkdown versions have changed.
Running
knitr::opts_chunk$set(collapse = TRUE)
didn't solve it.The text was updated successfully, but these errors were encountered: