🔍 An RStudio addin slash regex utility belt
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

17 lines
406B

  1. # highr:::escape_html
  2. # by Yihui Xie, GPL license
  3. # https://github.com/yihui/highr/blob/4f54a5b8960d6246daadacea1020ebcdc458ce50/R/utils.R#L54-L61
  4. escape_html <- function(x) {
  5. x <- gsub("&", "&amp;", x)
  6. x <- gsub("<", "&lt;", x)
  7. x <- gsub(">", "&gt;", x)
  8. x <- gsub('"', "&quot;", x)
  9. x
  10. }
  11. escape_backslash <- function(x) {
  12. gsub("\\\\", "\\\\\\\\", x)
  13. }
  14. utils::globalVariables(c("loc", "type"))