diff --git a/src/library/tools/R/Rd2HTML.R b/src/library/tools/R/Rd2HTML.R index c4635b8edfd..91e93aa7047 100644 --- a/src/library/tools/R/Rd2HTML.R +++ b/src/library/tools/R/Rd2HTML.R @@ -1299,16 +1299,15 @@ function(dir) x <- fsub("<", "<", x) x <- fsub(">", ">", x) if(a) { - ## CRAN also transforms - ## "<(URL: *)?((https?|ftp)://[^[:space:]]+)[[:space:]]*>" - ## - ## Sync regexp with what we use in .DESCRIPTION_to_latex()? - x <- trfm("([^>\"])((https?|ftp)://[[:alnum:]/.:@+\\_~%#?=&;,-]+[[:alnum:]/])", - "\\1\\2", + ## URL regexp as in .DESCRIPTION_to_latex(). CRAN uses + ## <(URL: *)?((https?|ftp)://[^[:space:]]+)[[:space:]]*> + ## ([^>\"])((https?|ftp)://[[:alnum:]/.:@+\\_~%#?=&;,-]+[[:alnum:]/]) + ## (also used in toRd.citation(). + x <- trfm("<(http://|ftp://|https://)([^[:space:],>]+)>", + "\\1\\2", x, urlify, 2L) - ## } if(d) { x <- trfm("<(DOI|doi):[[:space:]]*([^<[:space:]]+[[:alnum:]])>",