-
Notifications
You must be signed in to change notification settings - Fork 15
Open
Description
Reprex:
file.create("test.Rmd")
writeLines('
---
title: "Untitled"
output: html_document
---
```{r, cache = F, echo = F}
library(htmltools)
if (isTRUE(getOption("knitr.in.progress"))) {
message("I am knitting")
tagList(
div(id = "include-iframeResizer"),
htmlDependency(
name = "iframeResizer",
version = "4.2.8",
src = c(href = "https://cdn.jsdelivr.net/npm/iframe-resizer@4.2.8/js/",
file = "inst"),
script = "iframeResizer.contentWindow.min.js",
all_files = F
)
)
}
```', con = "test.Rmd")
sinew::pretty_rmd("test.Rmd", output = NULL, open_output = FALSE, create_library = FALSE)
Output is:
---
title: "Untitled"
output: html_document
---
```{r, cache = F, echo = F}
library(htmltools)
library(htmltools)
library(htmltools)
library(htmltools)
library(htmltools)
library(htmltools)
library(htmltools)
library(htmltools)
library(htmltools)
library(htmltools)
library(htmltools)
library(htmltools)
library(htmltools)
library(htmltools)
library(htmltools)
library(htmltools)
```
The bug is related to pretty_rmd.R#158 mapply simplifying to matrix when there's just one chunk.
This makes it such that pretty_rmd.R#L167 copies the first line to all lines.
Fixed by #67 by adding SIMPLIFY = FALSE to prevent simplification of output from mapply on an Rmd with a single chunk to an array/matrix.
Does not appear to be an issue when create_library = TRUE and pretty_rmd_library is used instead.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels