fansi (version 0.4.0)

html_esc: Escape Characters With Special HTML Meaning

Description

This allows displaying strings that contain them in HTML without disrupting the HTML. It is assumed that the string to be escaped does not contain actual HTML as this function would destroy it.

Usage

html_esc(x)

Arguments

x

character vector

Value

character vector consisting of x, but with the "<", ">", and "&" characters replaced by their HTML entity codes.

Examples

Run this code
# NOT RUN {
html_esc("day > night")
html_esc("<SPAN>hello world</SPAN>")
# }

Run the code above in your browser using DataLab