🔍 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.

13 lines
243B

  1. escape_html <- function(x) {
  2. x = gsub("&", "&amp;", x)
  3. x = gsub("<", "&lt;", x)
  4. x = gsub(">", "&gt;", x)
  5. x = gsub("\"", "&quot;", x)
  6. x = gsub(" ", "&nbsp;", x)
  7. x
  8. }
  9. escape_backslash <- function(x) {
  10. gsub("\\\\", "\\\\\\\\", x)
  11. }