Skip to content

Commit

Permalink
fix: escape "%" etc. in package_seealso_urls()
Browse files Browse the repository at this point in the history
  • Loading branch information
HenningLorenzen-ext-bayer committed Aug 11, 2022
1 parent 8e5c333 commit c2070c5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions R/object-package.R
@@ -1,15 +1,16 @@
package_seealso <- function(URL, BugReports) {
itemize("Useful links:", package_seealso_urls(URL, BugReports))
}

package_seealso_urls <- function(URL = NULL, BugReports = NULL) {
if (!is.null(URL)) {
links <- paste0("\\url{", strsplit(URL, ",\\s+")[[1]], "}")
links <- paste0("\\url{", escape(strsplit(URL, ",\\s+")[[1]]), "}")
links <- gsub("\\url\\{https://doi.org/", "\\doi{", links)
} else {
links <- character()
}
if (!is.null(BugReports)) {
links <- c(links, paste0("Report bugs at \\url{", BugReports, "}"))
links <- c(links, paste0("Report bugs at \\url{", escape(BugReports), "}"))
}

links
Expand Down

0 comments on commit c2070c5

Please sign in to comment.