replace_html_codes | R Documentation |
Occasionally,
we need to un-escape HTML codes in text.
If text
contains HTML codes, they are replaced with replacements
, which,
by default, describe replacements for "&
", "<
", and ">
"
("&
", "<
", and ">
", respectively).
replace_html_codes(
text,
replacements = list(c("&", "&"), c("<", "<"), c(">", ">"))
)
text |
a vector (or one-dimensional list) of character strings |
replacements |
a list of string pairs. Each pair consists of encoded string and unencoded string,
in that order. Default is
|
HTML codes can arrive in text read from an Excel file by the openxlsx
package
due to a bug documented here.
If text
is a vector, a vector of un-encoded strings.
If text
is a list of strings, a list of un-encoded strings of same structure.
If possible, an outgoing list has simplified structure, even to the point of
conversion to vector.
replace_html_codes(list("a", "&", "<", ">", "bcd"))
replace_html_codes(list(c("&", "&"), c("<", "<"), c(">", ">")))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.