Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In Latest shiny, html rendering code breaks in renderDataTable

Tags:

r

shiny

Below code used to work well till I upgraded my shiny. Now it just prints out the html text. Does not render it as html

ui.R

dataTableOutput("grid")

server.R

testLinks<-function(){
serial<-(1:2)
websites<-c("www.google.com","www.yahoo.com")
Link<-paste0("<a href=\"",websites,"\" target=\"_blank\">", websites,"</a>")
df<-data.frame(serial, websites,Link)
df
}

output$grid<-renderDataTable(testLinks())

Now it just renders the links as html text

Before the upgrade, it uses to render them as html links.

Any help, greatly appreciated.

like image 225
guna Avatar asked Sep 28 '22 21:09

guna


1 Answers

The escape argument in renderDataTable needs to be set to FALSE. I am assuming the default has been changed in this release. Causing my code to break. This has been fixed, by explicitly setting escape paramater to FALSE.

like image 87
guna Avatar answered Oct 05 '22 07:10

guna