From 588474a738021fbb2de9807fca19205e63805382 Mon Sep 17 00:00:00 2001 From: hornik Date: Fri, 28 Jul 2023 06:46:03 +0000 Subject: [PATCH] Tweaks for c84760. git-svn-id: https://svn.r-project.org/R/trunk@84771 00db46b3-68df-0310-9c12-caf00c1e9a41 --- src/library/tools/R/Rd2HTML.R | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) 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:]])>",