Closed etiennebacher closed 3 years ago
This PR adds support for MathJax, as requested in #54. Here's an example that works now:
library(shiny) ui <- fluidPage( withMathJax(), actionButton("btn", "show modal") ) server <- function(input, output, session) { observeEvent(input$btn, { shinyalert( text = div("$$\\sqrt{2}$$"), html = TRUE ) }) } shinyApp(ui, server)
I placed the line at the end of the JS function, but I don't have particular reasons for that. Let me know if you want me to change or add something.
Wouldn't this result in a javascript error when withMathJax() isn't called?
withMathJax()
I added a condition to avoid this javascript error
Thanks! Please add an entry to the NEWS.md file
Done
This PR adds support for MathJax, as requested in #54. Here's an example that works now:
I placed the line at the end of the JS function, but I don't have particular reasons for that. Let me know if you want me to change or add something.