Render an emphatic object to HTML
as_html(
x,
...,
font_size = NULL,
style = list(),
complete = FALSE,
browsable = FALSE
)
emphatic object
other arguments passed to as.character.emphatic()
CSS font-size. Default: NULL means to not adjust font size.
Otherwise, use valid CSS font-size
specification e.g.
"3em", "22px" etc.
html tag styling to apply to the <pre>
wrapper for the
returned HTML
logical. Default: FALSE. If TRUE, then add DOCTYPE and the tags for 'html', 'body' and 'head' to make a complete standalone html file.
Should the SVG be rendered to the RStudio Viewer pane when when printed (instead of console output)? Default: FALSE
Character string containing HTML representation
hl_diff('hello', 'there') |>
as_html() |>
cat()
#> <pre style=''>
#> <span><span>[1] "</span></span><span style='color:#000000;'><span style='background-color:#9aff9a;'> </span></span><span><span>he</span></span><span style='color:#000000;'><span style='background-color:#97ffff;'>ll</span></span><span style='color:#000000;'><span style='background-color:#ff7f50;'>o</span></span><span><span>"</span></span><br/><span><span>[1] "</span></span><span style='color:#000000;'><span style='background-color:#9aff9a;'>t</span></span><span><span>he</span></span><span style='color:#000000;'><span style='background-color:#97ffff;'>re</span></span><span style='color:#000000;'><span style='background-color:#ff7f50;'> </span></span><span><span>"</span></span>
#> </pre>