Closed shannonpileggi closed 3 years ago
This is interesting. Thanks for reporting.
It's not immediately apparent to me where or why this conversion happens, but I think it's the interaction between R, JavaScript and HTML. It may even be a pure function of HTML.
But here is a workaround for you:
 
) in HTMLshiny::HTML()
to ensure shiny interprets the strings as HTMLLike this:
my_list <-
c(
" A A A ",
" B. B. B. ",
" C. C. C. "
) %>%
purrr::map_chr(~gsub(" ", " ", .)) %>%
purrr::map(HTML)
Thanks for taking a look and thanks for the workaround! I actually didn't need the white spaces for my purposes, I just wasn't aware that I had them. I fixed my issue by modifying the input:
my_list <- stringr::str_squish(c(" A A A ", " B. B. B. ", " C. C. C. "))
Thanks for this amazing widget! This works perfectly for my ap.
I did run into an issue that took me a while to debug. It appears that there is some str_squish type behavior happening behind the scenes that removes extra white spaces. Did I miss this in the documentation? Is there an argument to turn this off or on? If so, apologies for not seeing it! An example is below. If this isn't yet documented, it would be helpful to make this more obvious to the user.
Thanks again!
Created on 2020-08-21 by the reprex package (v0.3.0)