Skip to content

Commit

Permalink
Tweaks for c84760.
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.r-project.org/R/trunk@84771 00db46b3-68df-0310-9c12-caf00c1e9a41
  • Loading branch information
hornik committed Jul 28, 2023
1 parent fafdc99 commit 588474a
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/library/tools/R/Rd2HTML.R
Original file line number Diff line number Diff line change
Expand Up @@ -1299,16 +1299,15 @@ function(dir)
x <- fsub("<", "&lt;", x)
x <- fsub(">", "&gt;", x)
if(a) {
## CRAN also transforms
## "&lt;(URL: *)?((https?|ftp)://[^[:space:]]+)[[:space:]]*&gt;"
## <FIXME>
## Sync regexp with what we use in .DESCRIPTION_to_latex()?
x <- trfm("([^>\"])((https?|ftp)://[[:alnum:]/.:@+\\_~%#?=&;,-]+[[:alnum:]/])",
"\\1<a href=\"%s\">\\2</a>",
## URL regexp as in .DESCRIPTION_to_latex(). CRAN uses
## &lt;(URL: *)?((https?|ftp)://[^[:space:]]+)[[:space:]]*&gt;
## ([^>\"])((https?|ftp)://[[:alnum:]/.:@+\\_~%#?=&;,-]+[[:alnum:]/])
## (also used in toRd.citation().
x <- trfm("&lt;(http://|ftp://|https://)([^[:space:],>]+)&gt;",
"<a href=\"\\1%s\">\\1\\2</a>",
x,
urlify,
2L)
## </FIXME>
}
if(d) {
x <- trfm("&lt;(DOI|doi):[[:space:]]*([^<[:space:]]+[[:alnum:]])&gt;",
Expand Down

0 comments on commit 588474a

Please sign in to comment.