Skip to content

Commit

Permalink
Allow multiple emails for authors (#1529)
Browse files Browse the repository at this point in the history
Fixes #1487
  • Loading branch information
jmbarbone authored Nov 6, 2023
1 parent a6ab093 commit 3d162cb
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# roxygen2 (development version)

* authors in `DESCRIPTION` can now have multiple email addresses (@jmbarbone, #1487).

* The `ROXYGEN_PKG` environment variable is now set up while roxygen
is running to the name of the package being documented (#1517).

Expand Down
2 changes: 1 addition & 1 deletion R/object-package.R
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ author_desc <- function(x) {
}

if (!is.null(x$email)) {
desc <- paste0(desc, " \\email{", x$email, "}")
desc <- paste0(desc, " \\email{", paste(x$email, collapse = ", "), "}")
}

if (!is.null(x$comment)) {
Expand Down
8 changes: 8 additions & 0 deletions tests/testthat/test-object-package.R
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,11 @@ test_that("autolink several matching patterns", {
)
)
})

test_that("multiple email addresses for a person are acceptable #1487", {
me <- person("me", email = c("one@email.me", "two@email.me"))
expect_equal(
author_desc(unclass(me)[[1]]),
"me \\email{one@email.me, two@email.me}"
)
})

0 comments on commit 3d162cb

Please sign in to comment.