Repository navigation
Closed
Description
To reproduce:
contents <- "
```{r}
library(bookdown)
```
---
site: bookdown::bookdown_site
---
```
"
dir <- tempfile("rmarkdown-repro-")
dir.create(dir)
writeLines(contents, con = file.path(dir, "index.Rmd"))
rmarkdown::site_generator(dir)
After running this code, the R console will be busy waiting for input from the user:
It looks like this happens because rmarkdown inadvertently calls parse(text = NULL) here:
Line 270 in 2989595
| create_site_generator <- eval(parse(text = front_matter$site)) |
It might be possible to trigger this bug in a couple other places where parse(text = ...) is used:
$ rg -F 'parse(text'
R/html_resources.R
335: output_format_function <- eval(parse(text = output_format$name))
R/render_site.R
270: create_site_generator <- eval(parse(text = front_matter$site))
R/output_format.R
401: format_function <- eval(parse(text = format$name))
599: output_format_func <- eval(parse(text = name))
R/shiny_prerendered.R
31: eval(parse(text = server_start_context), envir = server_envir)
42: eval(parse(text = .server_context))
499: parse(text = code)
so it could be worth sanity-checking those usages as well.
See also: rstudio/rstudio#8954
By filing an issue to this repo, I promise that
- I have fully read the issue guide at https://yihui.org/issue/.
- I have provided the necessary information about my issue.
- If I'm asking a question, I have already asked it on Stack Overflow or RStudio Community, waited for at least 24 hours, and included a link to my question there.
- If I'm filing a bug report, I have included a minimal, self-contained, and reproducible example, and have also included
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'). - If I have posted the same issue elsewhere, I have also mentioned it in this issue.
- I have learned the Github Markdown syntax, and formatted my issue correctly.
I understand that my issue may be closed if I don't fulfill my promises.
Reacted by mirh

Activity
cderv commentedon Feb 11, 2021
Thanks for the investigation @kevinushey !
We should clearly deal with with some checks in the different place.
I believe we should also fail earlier with
render_siteif no front matter is correctly parsed. The tools works only if the document starts with a YAML front matter.yihui commentedon May 18, 2021
Fixed now. Thanks for the report!
Merge remote-tracking branch 'rstudio_origin/master'
Merge with latest RStudio version (2.9.1).
Merge with latest RStudio version (2.9.1).
github-actions commentedon Nov 16, 2021
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.