has_ctl | R Documentation |
has_ctl
checks for any Control Sequence. You can check for different
types of sequences with the ctl
parameter. Warnings are only emitted for
malformed CSI or OSC sequences.
has_ctl(x, ctl = "all", warn = getOption("fansi.warn", TRUE), which)
x |
a character vector or object that can be coerced to such. |
ctl |
character, which Control Sequences should be treated
specially. Special treatment is context dependent, and may include
detecting them and/or computing their display/character width as zero. For
the SGR subset of the ANSI CSI sequences, and OSC hyperlinks,
|
warn |
TRUE (default) or FALSE, whether to warn when potentially
problematic Control Sequences are encountered. These could cause the
assumptions |
which |
character, deprecated in favor of |
logical of same length as x
; NA values in x
result in NA values
in return
?fansi
for details on how Control Sequences are
interpreted, particularly if you are getting unexpected results,
unhandled_ctl
for detecting bad control sequences.
has_ctl("hello world")
has_ctl("hello\nworld")
has_ctl("hello\nworld", "sgr")
has_ctl("hello\033[31mworld\033[m", "sgr")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.