Skip to content

Commit

Permalink
Add if to TWOTAGs (#1320)
Browse files Browse the repository at this point in the history
Fixes #1097.
  • Loading branch information
hadley authored Apr 6, 2022
1 parent 0ecdcde commit b5ec35e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion R/utils-rd.R
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ make_as_character_rd <- function() {
return(fn)
}

body[[idx]][[3]] <- call_modify(body[[idx]][[3]], "\\href", "\\ifelse")
body[[idx]][[3]] <- call_modify(body[[idx]][[3]], "\\href", "\\ifelse", "\\if")
body(fn) <- body
fn
}
Expand Down
6 changes: 2 additions & 4 deletions tests/testthat/test-rd-inherit.R
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,10 @@ test_that("\\links are transformed", {
expect_snapshot_output(out$get_section("param"))
})

test_that("href doesn't get extra parens", {
test_that("markdown doesn't get get extra parens", {
expect_equal(rd2text(parse_rd("\\href{a}{b}")), "\\href{a}{b}\n")
})

test_that("ifelse doesn't get extra parens", {
expect_equal(rd2text(parse_rd("\\ifelse{a}{b}{c}")), "\\ifelse{a}{b}{c}\n")
expect_equal(rd2text(parse_rd("\\if{a}{b}")), "\\if{a}{b}\n")
})

test_that("relative links converted to absolute", {
Expand Down

0 comments on commit b5ec35e

Please sign in to comment.