Skip to content

Comments behind YAML argument "cite" breaks rendering of book #1194

@LDSamson

Description

@LDSamson

When there is any comment written behind the YAML header option "site: ", an error occurs which breaks the rendering of any book (gitbook/PDF/EPUB). Exact error message is shown below. This problem did not occur in previous versions of the package. Comments behind any other argument do not cause this issue, as far as I noticed.

The problem can be reproduced with the bookdown demo version, using the YAML below. The only thing changed here from the original YAML is the small comment behind the argument site: bookdown::bookdown_site.

--- 
title: "A Minimal Book Example"
author: "Yihui Xie"
date: "`r Sys.Date()`"
site: bookdown::bookdown_site # any comment
output: bookdown::gitbook
documentclass: book
bibliography: [book.bib, packages.bib]
biblio-style: apalike
link-citations: yes
github-repo: rstudio/bookdown-demo
description: "This is a minimal example of using the bookdown package to write a book. The output format for this example is bookdown::gitbook."
---

Error message when trying to render the book:

Error in setwd(book_proj) : character argument expected. Calls: <Anonymous> -> site_generator -> create_site_generator -> setwd
Execution halted
Exited with status 1.

Rstudio version: 1.4.1717
R version 4.1.0
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19043)

attached base packages:
stats graphics grDevices utils datasets methods base

loaded via a namespace (and not attached):
compiler_4.1.0 bookdown_0.22 htmltools_0.5.1.1 tools_4.1.0 yaml_2.2.1
rmarkdown_2.9 knitr_1.33 xfun_0.24 digest_0.6.27 rlang_0.4.11
evaluate_0.14

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugan unexpected problem or unintended behaviornextto consider for next release

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions