diff --git a/NEWS.md b/NEWS.md index 248a35b7..1ee8fbc7 100644 --- a/NEWS.md +++ b/NEWS.md @@ -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). diff --git a/R/object-package.R b/R/object-package.R index b0c25ed9..51060a7a 100644 --- a/R/object-package.R +++ b/R/object-package.R @@ -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)) { diff --git a/tests/testthat/test-object-package.R b/tests/testthat/test-object-package.R index 658a101f..0bbea812 100644 --- a/tests/testthat/test-object-package.R +++ b/tests/testthat/test-object-package.R @@ -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}" + ) +})