Skip to content

Commit 23f6139

Browse files
committed
feat: render htmltools
1 parent a6f5089 commit 23f6139

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

R/response.R

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,22 @@ convert_body <- function(body) {
6060
return(as.character(body))
6161

6262
if(inherits(body, "shiny.tag") || inherits(body, "shiny.tag.list"))
63-
return(htmltools::doRenderTags(body))
63+
return(render_htmltools(body))
6464

6565
body
6666
}
6767

68+
render_htmltools <- function(x) {
69+
tmp <- tempfile(fileext = ".html")
70+
on.exit({
71+
unlink(tmp)
72+
})
73+
save_html(x, tmp)
74+
75+
read_lines(tmp) |>
76+
(\(.) paste0(., collapse = ""))()
77+
}
78+
6879
#' Construct Response
6980
#'
7081
#' @noRd

0 commit comments

Comments
 (0)