sgr_to_html | R Documentation |
This function is a wrapper around to_html
and is kept around for legacy
reasons. When we added capabilities for handling OSC hyperlinks, the sgr_
part of the name became an incomplete description of what the function
does. The only substantive difference with the new function is this one does
not warn when the input contains unescaped "<" or ">".
sgr_to_html(
x,
warn = getOption("fansi.warn", TRUE),
term.cap = getOption("fansi.term.cap", dflt_term_cap()),
classes = FALSE,
carry = getOption("fansi.carry", TRUE)
)
x |
a character vector or object that can be coerced to such. |
warn |
TRUE (default) or FALSE, whether to warn when potentially
problematic Control Sequences are encountered. These could cause the
assumptions |
term.cap |
character a vector of the capabilities of the terminal, can
be any combination of "bright" (SGR codes 90-97, 100-107), "256" (SGR codes
starting with "38;5" or "48;5"), "truecolor" (SGR codes starting with
"38;2" or "48;2"), and "all". "all" behaves as it does for the |
classes |
FALSE (default), TRUE, or character vector of either 16, 32, or 512 class names. Character strings may only contain ASCII characters corresponding to letters, numbers, the hyphen, or the underscore. It is the user's responsibility to provide values that are legal class names.
|
carry |
TRUE, FALSE (default), or a scalar string, controls whether to
interpret the character vector as a "single document" (TRUE or string) or
as independent elements (FALSE). In "single document" mode, active state
at the end of an input element is considered active at the beginning of the
next vector element, simulating what happens with a document with active
state at the end of a line. If FALSE each vector element is interpreted as
if there were no active state when it begins. If character, then the
active state at the end of the |
A character vector of the same length as x
with all escape
sequences removed and any basic ANSI CSI SGR escape sequences applied via
SPAN HTML tags.
Unlike other functions, the default is carry = TRUE
for compatibility
with semantics of prior versions of fansi
.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.