From 71a2e968f4453858aadc1531a3774c011a6f9f49 Mon Sep 17 00:00:00 2001 From: smeyer Date: Tue, 10 Dec 2024 13:53:46 +0000 Subject: [PATCH] tweak c84551 git-svn-id: https://svn.r-project.org/R/trunk@87435 00db46b3-68df-0310-9c12-caf00c1e9a41 --- src/library/tools/R/RdConv2.R | 3 ++- tests/reg-packages.R | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/library/tools/R/RdConv2.R b/src/library/tools/R/RdConv2.R index a7d3fae3e85..409c35754ea 100644 --- a/src/library/tools/R/RdConv2.R +++ b/src/library/tools/R/RdConv2.R @@ -213,7 +213,7 @@ processRdChunk <- function(code, stage, options, env, macros) res <- character(0) tags <- RdTags(code) - if (length(bad <- setdiff(tags, c("RCODE", "COMMENT")))) + if (length(bad <- setdiff(tags, c("RCODE", "TEXT", "COMMENT")))) ## also USERMACROs are currently not supported inside \Sexpr{} warnRd(code, Rdfile, "\\Sexpr expects R code; found ", paste0(sQuote(bad), collapse = ", ")) @@ -379,6 +379,7 @@ processRdIfdefs <- function(blocks, defines) tagged(list( tagged(paste(tag, target, "not active"), "COMMENT", attr(block, "srcref")), + ## converters expect (and drop) newline from COMMENT tagged("\n", "TEXT", attr(block, "srcref")) ), "#expanded") diff --git a/tests/reg-packages.R b/tests/reg-packages.R index 1a01b4fd43e..cda495e545b 100644 --- a/tests/reg-packages.R +++ b/tests/reg-packages.R @@ -478,7 +478,8 @@ stopifnot(exprs = { any(grepl("See Also:", helptxt, fixed = TRUE)) == (.Platform$OS.type == "windows") ## post-build macros can contain conditional defines -tools::Rd2txt(installedRdDB[["nestedDefinesOK.Rd"]]) +tools::Rd2txt(installedRdDB[["nestedDefinesOK.Rd"]], + options = list(underline_titles = FALSE)) deparsedLines <- as.character(installedRdDB[["nestedDefinesOK.Rd"]]) stopifnot(("unix" %in% deparsedLines) == (.Platform$OS.type == "unix"), ("windows" %in% deparsedLines) == (.Platform$OS.type == "windows"))