R/js-quote.R

#' Escape a JS String
#' 
#' Escape a String to be sent to JavaScript
#' @param text The text to escape
#' @author Jeff Allen \email{jeff@@trestletech.com}
jsQuote <- function(text){
  toReturn <- shQuote(text)
  toReturn <- gsub('\n', '\\\\n', toReturn)
  toReturn
}
skranz/shinyAce2 documentation built on May 30, 2019, 3:02 a.m.