From 1ffd96c83e050643e274e770f02523ad819d56d2 Mon Sep 17 00:00:00 2001 From: Yihui Xie Date: Mon, 9 Oct 2023 09:03:51 -0500 Subject: [PATCH] fix #1442: make sure the fallback index file list is of length 1 before checking if it exists --- DESCRIPTION | 2 +- NEWS.md | 1 + R/utils.R | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 4d302ccb..c22c91d8 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: bookdown Type: Package Title: Authoring Books and Technical Documents with R Markdown -Version: 0.35.1 +Version: 0.35.2 Authors@R: c( person("Yihui", "Xie", role = c("aut", "cre"), email = "xie@yihui.name", comment = c(ORCID = "0000-0003-0645-5666")), person("Christophe", "Dervieux", , "cderv@posit.co", role = c("ctb"), diff --git a/NEWS.md b/NEWS.md index 7d6c2148..a638acce 100644 --- a/NEWS.md +++ b/NEWS.md @@ -2,6 +2,7 @@ - Fix an issue with parsing resources from raw HTML code (thanks, @lennylin, https://community.rstudio.com/t/bookdown-image-with-a-weblink/172542) +- R 4.3.x would error if multiple files are passed to `render_book()` without an `output_format` specified (thanks, @slodge-work, #1442). # CHANGES IN bookdown VERSION 0.35 diff --git a/R/utils.R b/R/utils.R index a0ba3dee..9599b43a 100644 --- a/R/utils.R +++ b/R/utils.R @@ -413,7 +413,7 @@ get_output_formats = function(fallback_format, filter = identity, first = FALSE, index = get_index_file() # Use fallback file unless no YAML if (is_empty(index)) { - if (!is.null(fallback_index) && + if (length(fallback_index) == 1 && xfun::file_exists(fallback_index) && length(rmarkdown::yaml_front_matter(fallback_index)) != 0 ) {