Skip to content

Commit

Permalink
print HTML as raw strings too
Browse files Browse the repository at this point in the history
  • Loading branch information
yihui committed Jan 10, 2025
1 parent bdd2c1e commit 233d8f0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions R/string.R
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ strip_html = function(x) {
'keygen', 'link', 'meta', 'param', 'source', 'track', 'wbr'
)

.html_class = c('xfun_html', 'html')
.html_class2 = c(.html_class <- c('xfun_html', 'html'), 'xfun_raw_string')

#' Tools for HTML tags
#'
Expand Down Expand Up @@ -453,7 +453,7 @@ html_content = function(x) {
#' `html_value()`, escaped for `html_escape()`, and viewed for `html_view()`.
#' @rdname html_tag
#' @export
html_value = function(x) structure(x, class = .html_class)
html_value = function(x) structure(x, class = .html_class2, lang = '.html')

#' @param attr Whether to escape `"`, `\r`, and `\n` (which should be escaped
#' for tag attributes).
Expand Down

0 comments on commit 233d8f0

Please sign in to comment.