Skip to content

Commit

Permalink
chapter_name may not be a character vector of length 1
Browse files Browse the repository at this point in the history
  • Loading branch information
yihui committed Apr 6, 2017
1 parent 9ea8ffa commit f23b2d4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@

- Some text references do not work for HTML and Word output (thanks, @ugroempi, #363).

- The option `chapter_name` in `_bookdown.yml` does not work when it is specified as a function (thanks, @tzerk, 0c05c3828be).

## MINOR CHANGES

- The `daemon` argument was removed from `serve_book()`, but you can still pass it to `servr::httw()` via the `...` argument.
Expand Down
2 changes: 1 addition & 1 deletion R/html.R
Original file line number Diff line number Diff line change
Expand Up @@ -653,7 +653,7 @@ add_toc_ids = function(toc) {
add_chapter_prefix = function(content) {
config = load_config()
chapter_name = config[['chapter_name']] %n% ui_language('chapter_name')
if (is.null(chapter_name) || chapter_name == '') return(content)
if (is.null(chapter_name) || identical(chapter_name, '')) return(content)
chapter_fun = if (is.character(chapter_name)) {
function(i) switch(
length(chapter_name), paste0(chapter_name, i),
Expand Down

0 comments on commit f23b2d4

Please sign in to comment.