EVOLUTION-MANAGER
Edit File: sgr_to_html.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: Convert ANSI CSI SGR Escape Sequence to HTML Equivalents</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="R.css" /> </head><body> <table width="100%" summary="page for sgr_to_html {fansi}"><tr><td>sgr_to_html {fansi}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Convert ANSI CSI SGR Escape Sequence to HTML Equivalents</h2> <h3>Description</h3> <p>Only the colors, background-colors, and basic styles (CSI SGR codes 1-9) are translated. Others are dropped silently. </p> <h3>Usage</h3> <pre> sgr_to_html(x, warn = getOption("fansi.warn"), term.cap = getOption("fansi.term.cap")) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>x</code></td> <td> <p>a character vector or object that can be coerced to character.</p> </td></tr> <tr valign="top"><td><code>warn</code></td> <td> <p>TRUE (default) or FALSE, whether to warn when potentially problematic <em>Control Sequences</em> are encountered. These could cause the assumptions <code>fansi</code> makes about how strings are rendered on your display to be incorrect, for example by moving the cursor (see <a href="fansi.html">fansi</a>).</p> </td></tr> <tr valign="top"><td><code>term.cap</code></td> <td> <p>character a vector of the capabilities of the terminal, can be any combination "bright" (SGR codes 90-97, 100-107), "256" (SGR codes starting with "38;5" or "48;5"), and "truecolor" (SGR codes starting with "38;2" or "48;2"). Changing this parameter changes how <code>fansi</code> interprets escape sequences, so you should ensure that it matches your terminal capabilities. See <a href="term_cap_test.html">term_cap_test</a> for details.</p> </td></tr> </table> <h3>Value</h3> <p>a character vector with all escape sequences removed and any basic ANSI CSI SGR escape sequences applied via SPAN html objects with inline css styles. </p> <h3>Note</h3> <p>Non-ASCII strings are converted to and returned in UTF-8 encoding. </p> <h3>See Also</h3> <p><a href="fansi.html">fansi</a> for details on how <em>Control Sequences</em> are interpreted, particularly if you are getting unexpected results, <code><a href="set_knit_hooks.html">set_knit_hooks()</a></code> for how to use ANSI CSI styled text with knitr and HTML output. </p> <h3>Examples</h3> <pre> sgr_to_html("hello\033[31;42;1mworld\033[m") </pre> <hr /><div style="text-align: center;">[Package <em>fansi</em> version 0.4.1 <a href="00Index.html">Index</a>]</div> </body></html>