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).
Arguments
- 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
list(c("&", "&"), c("<", "<"), c(">", ">"))
Value
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.
Details
HTML codes can arrive in text read from an Excel file by the openxlsx
package
due to a bug documented here.