In Latest shiny, html rendering code breaks in renderDataTable

末鹿安然 提交于 2019-12-30 23:50:31

问题


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.


回答1:


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.



来源:https://stackoverflow.com/questions/28269585/in-latest-shiny-html-rendering-code-breaks-in-renderdatatable

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!