Skip to content

Commit 9612c3a

Browse files
author
hornik
committed
Tweaks.
git-svn-id: https://svn.r-project.org/R/trunk@87331 00db46b3-68df-0310-9c12-caf00c1e9a41
1 parent 93ca699 commit 9612c3a

File tree

1 file changed

+18
-2
lines changed
  • src/library/tools/R

1 file changed

+18
-2
lines changed

src/library/tools/R/Rd.R

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -475,8 +475,24 @@ function(x, kind)
475475
x <- x[RdTags(x) == sprintf("\\%s", kind)]
476476
if(!length(x))
477477
character()
478-
else
478+
else {
479+
## <NOTE>
480+
## WRE says that
481+
## Each @code{\concept} entry should give a @emph{single}
482+
## index term (word or phrase), and not use any Rd markup.
483+
## but at least for now we use \I{...} for spell checking.
484+
if(kind == "concept")
485+
x <- lapply(x, function(e) {
486+
if((length(e) > 1L) &&
487+
identical(attr(e[[1L]], "Rd_tag"), "USERMACRO") &&
488+
identical(attr(e[[1L]], "macro"), "\\I"))
489+
e[-1L]
490+
else
491+
e
492+
})
493+
## </NOTE>
479494
unique(trimws(vapply(x, paste, "", collapse = "\n")))
495+
}
480496
}
481497

482498
### * .Rd_keywords_auto
@@ -834,7 +850,7 @@ function(x)
834850
tag <- attr(e, "Rd_tag")
835851
if(identical(tag, "\\link")) {
836852
val <- if(length(e)) { # mvbutils has empty links
837-
arg <- as.character(e[[1L]])
853+
arg <- paste(vapply(e, trimws, ""), collapse = " ")
838854
opt <- attr(e, "Rd_option")
839855
c(arg, if(is.null(opt)) "" else as.character(opt))
840856
} else c("", "")

0 commit comments

Comments
 (0)