-
Notifications
You must be signed in to change notification settings - Fork 522
Closed
Milestone
Description
Following #254 comment, the continuation prompt should be + for code chunk, evaluated or not.
That means
```{r}
f <- function(a, b) mean(c(a,b))
f(a = 1,
b = 2)
```
or
```{r, eval = FALSE}
f <- function(a, b) mean(c(a,b))
f(a = 1,
b = 2)
```shoult be rendered as this in both case
R> f <- function(a, b) mean(c(a,b))
R> f(a = 1,
+ b = 2)
Currently, it is not the case. #294 fixed part of the issue in rticles by changing R+ to + but this works only for evaluated chunks.
In fact, the transformation is based on a hook
Lines 46 to 53 in ec5e82b
| hook_input <- function(x, options) { | |
| if (options$prompt && length(x)) { | |
| x <- gsub("\\n", paste0("\n", "+ "), x) | |
| x <- paste0("R> ", x) | |
| } | |
| paste0(c('\n\\begin{CodeInput}', x, '\\end{CodeInput}', ''), | |
| collapse = '\n') | |
| } |
but for
eval=FALSE , chunk input is not parsed the same as when eval=TRUE so the hook does not apply the same.It could be a bug elsewhere than rticles...
Metadata
Metadata
Assignees
Labels
No labels