Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion R/bs4_book.R
Original file line number Diff line number Diff line change
Expand Up @@ -596,7 +596,7 @@ tweak_metadata <- function(html, path) {
if (nzchar(text)) {
words <- unlist(strsplit(text, " "))
no_char <- cumsum(unlist(lapply(words, function(x) {nchar(x) + 1})))
max_n <- max(which(no_char<= 197))
max_n <- max(which(no_char <= 197), 1)
description_string <- paste(words[1: max_n], collapse = " ")
if (max_n != length(words)) {
description_string <- paste0(description_string, "...")
Expand Down