diff --git a/NEWS.md b/NEWS.md index 5e87e986..54077685 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,8 @@ # roxygen2 (development version) +* Arguments containing non-syntactic values surrounded by back ticks are now + wrapped correctly (#1257). + * DOIs in the `URL` field of the `DESCRIPTION` are now converted to Rd's special `\doi{}` tag (@ThierryO, #1296). diff --git a/src/wrapUsage.cpp b/src/wrapUsage.cpp index ec063913..5a479caa 100644 --- a/src/wrapUsage.cpp +++ b/src/wrapUsage.cpp @@ -27,7 +27,7 @@ std::vector splitByWhitespace(std::string string) { } else if (*cur == ' ' || *cur == '\t' || *cur == '\n') { out.push_back(acc); acc = ""; - } else if (*cur == '"' || *cur == '\'') { + } else if (*cur == '"' || *cur == '\'' || *cur == '`') { in_string = *cur; acc += *cur; } else { diff --git a/tests/testthat/_snaps/rd-usage.md b/tests/testthat/_snaps/rd-usage.md index 9dfbd39b..99daed92 100644 --- a/tests/testthat/_snaps/rd-usage.md +++ b/tests/testthat/_snaps/rd-usage.md @@ -27,8 +27,8 @@ x, y, xy = "abcdef", - xyz = c(`word word word word` = "abcdef", `word word word` = "abcdef", `word word - word` = "abcdef", `word word word` = "abcdef") + xyz = c(`word word word word` = "abcdef", `word word word` = "abcdef", + `word word word` = "abcdef", `word word word` = "abcdef") )