Skip to content

Commit

Permalink
avoid insertion of '.' in family tag (closes r-lib#477)
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinushey committed May 26, 2016
1 parent 7133fd6 commit 0a4a0c1
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
3 changes: 3 additions & 0 deletions NEWS.md
@@ -1,5 +1,8 @@
# roxygen2 5.0.1.9000

* Fixed an issue where `.`s were sometimes added between words within
a `@family` tag (#477, @kevinushey).

# roxygen2 5.0.1

* Use `ls()`, not `names()` to list elements of environment: fixes R 3.1.0
Expand Down
3 changes: 2 additions & 1 deletion R/family.R
Expand Up @@ -28,7 +28,8 @@ process_family <- function(topics) {

invert <- function(x) {
if (length(x) == 0) return()
utils::unstack(rev(utils::stack(x)))
stacked <- utils::stack(x)
tapply(as.character(stacked$ind), stacked$values, c)
}

get_values <- function(topics, tag) {
Expand Down
3 changes: 3 additions & 0 deletions tests/testthat/test-family.R
Expand Up @@ -21,6 +21,7 @@ test_that("long families are wrapped", {
")[[1]]

seealso <- get_tag(out, "seealso")$values
expect_true(grepl("^Other Long family name:", seealso))
expect_equal(str_count(seealso, "\n"), 2)

})
Expand All @@ -37,6 +38,7 @@ test_that("special names escaped in family tag", {
")[[1]]

seealso <- get_tag(out, "seealso")$values
expect_true(grepl("^Other Long family name:", seealso))
expect_match(seealso, "\\\\%\\+\\\\%")

})
Expand All @@ -57,6 +59,7 @@ test_that("family links to name only, not all aliases", {
")[[1]]

seealso <- get_tag(out, "seealso")$values
expect_true(grepl("^Other many aliases:", seealso))
expect_equal(str_count(seealso, fixed("\\code{\\link")), 1)

})

0 comments on commit 0a4a0c1

Please sign in to comment.