Skip to content

Commit

Permalink
ft: improve handling of shiny & htmltools tags
Browse files Browse the repository at this point in the history
  • Loading branch information
kennedymwavu committed Nov 13, 2024
1 parent 22ba149 commit 9f49c97
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions R/response.R
Original file line number Diff line number Diff line change
Expand Up @@ -56,16 +56,13 @@ convert_body <- function(body) {
if(inherits(body, "AsIs"))
return(body)

if(is.raw(body))
return(body)

if(is.character(body) && length(body) == 1L)
return(body)

if(is.factor(body) || inherits(body, "shiny.tag"))
if (is.factor(body))
return(as.character(body))

return(body)
if(inherits(body, "shiny.tag") || inherits(body, "shiny.tag.list"))
return(htmltools::doRenderTags(body))

body
}

#' Construct Response
Expand Down

0 comments on commit 9f49c97

Please sign in to comment.