ebailey78 / shinyBS

Twitter Bootstrap Components for Shiny
182 stars 47 forks source link

bsPopover HTML content #22

Closed akaever closed 9 years ago

akaever commented 9 years ago

Hi,

Thank you for your work.

I encountered an issue with HTML content which seems to be escaped in the bsPopover function, see

bsPopover("linkID", title="title", content="<b>Test</b>")

which results in

<script>
$(document).ready(function() {
    setTimeout(function() {shinyBS.addTooltip('linkID', 'popover', 
    {'content': '&lt;b&gt;Test&lt;/b&gt;', 'placement': 'bottom', 'trigger': 'hover', 'title': 'title'}
    )}, 100) });
</script> 

Directly masking HTML does not work, either:

content=HTML("<b>Test</b>")

My current workaround is replacing the JavaScript code manually:

bsPopoverTag <- bsPopover("linkID", title="title", content="<b>Test</b>")
bsPopoverHTML <- HTML("$(document).ready(function() {setTimeout(function() { shinyBS.addTooltip('linkID', 'popover', {'content': '<b>Test</b>', 'placement': 'bottom', 'trigger': 'hover', 'title': 'title'})}, 100)});")
bsPopoverTag$children[[1]] <- bsPopoverHTML

Thanks Alex

ebailey78 commented 9 years ago

Thank you for bringing that to my attention. I thought I fixed that problem. HTML worked with addPopover from the server but not with bsPopover in the UI. I think it is fixed now. Let me know if you have any problems.

Thanks,

Eric

akaever commented 9 years ago

It works!

Thanks Alex