Nothing
#' Replace HTML special characters with HTML entities
#'
#' The characters \code{c("&", '"', "'", "<", ">")} will be replaced with
#' \code{c("&", """, "'", "<", ">")}, respectively.
#' @param string the string with (or w/o) HTML special chars
#' @return the string with special chars replaced.
#' @author Yihui Xie <\url{https://yihui.org}>
#' @seealso \code{\link{gsub}}
#' @references \url{https://www.php.net/manual/en/function.htmlspecialchars.php}
#' @export
#' @examples
#' htmlspecialchars("<a href = 'https://yihui.org'>Yihui</a>")
#' # <a href = 'https://yihui.org'>Yihui</a>
htmlspecialchars <- function(string) {
x = c("&", '"', "'", "<", ">")
subx = c("&", """, "'", "<", ">")
for (i in seq_along(x)) {
string = gsub(x[i], subx[i], string, fixed = TRUE)
}
string
}
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.