Skip to content

Commit

Permalink
Fix new line issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Ilia-Kosenkov committed Jan 12, 2024
1 parent 1450b1a commit 8650121
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions R/toml_serialization.R
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ to_toml <- function(...,
.format_dbl = .format_dbl
)
body <- glue_collapse(body, "\n")
if (!nzchar(body)) {
body <- NULL
}

# The values can be (1) header and body, (2) header only, or (3) body only.
# In the case of (2) and (3) the other element is of length 0, so we need to
# remove them by `c()` first, and then concatenate by "\n" if both exists
Expand Down

0 comments on commit 8650121

Please sign in to comment.