Skip to content

bs_embed_popover escapes HTML #62

Open

Description

@thfuchs

Inside content, bs_embed_popover does not render html tags. Here I have a minimal example which just displays the html code for €:

tags$a("Link with popover", href = "#") %>% bsplus::bs_embed_popover(
              title = "xx",
              content = HTML("€"),
              placement = "bottom",
              trigger = "hover focus"
)

Is there any workaround to render html signs properly?

Activity

  1. ijlyttle commented on Jul 30, 2019

    @ijlyttle
    Owner

    What if you did something like this:

    tags$a("Link with popover", href = "#") %>% 
      bsplus::bs_embed_popover(
        title = "xx",
        content = "&#8364",
        placement = "bottom",
        trigger = "hover focus"
      )
  2. thfuchs commented on Jul 30, 2019

    @thfuchs
    Author

    same result..

  3. ijlyttle commented on Jul 30, 2019

    @ijlyttle
    Owner

    Gah!

    I think the problem might be here:

    attributes_bs <- do.call(bs_map_attr, c(list(.prefix = .prefix), attributes_raw))

    I suspect that the c() function is stripping the HTML class from the character string.

    I'll need to think about how to work around this....

  4. thfuchs commented on Aug 31, 2019

    @thfuchs
    Author

    Found a workaraound using html="true" on stackoverflow: https://stackoverflow.com/questions/54424978/bs-embed-popover-html-tags-in-content-variable

    tags$a("Link with popover", href = "#") %>% 
                bsplus::bs_embed_popover(
                    title = "xx",
                    content = HTML("&#8364;"),
                    placement = "bottom",
                    trigger = "hover focus", 
                    html = TRUE
                )
  5. ijlyttle commented on Aug 31, 2019

    @ijlyttle
    Owner

    Super!

    If it's OK with you, I'd like to leave this issue open to remind me to see if this is something that can be coded, or if I should document the workaround.

  6. thfuchs commented on Aug 31, 2019

    @thfuchs
    Author

    Of course, Thanks anyway for your package!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions