I have an app running on shiny server and I would like to format smalls parts of text without needing to manage the css/html for the entirety of the page.
In the ui.r
, I have some lines of help text that I would like to stylize.
sidebarPanel(
...
, helpText("<I>Can</I> <em>this</em> <strong>happen</strong>?")
)
Which gives:
# Current Output:
<I>Can</I> <em>this</em> <strong>happen</strong>?
#desired Output:
Can this happen?
The text is (understandably) rendered as a literal string.
Is there a function or command to force the HTML to be parsed?
Use this:
sidebarPanel(
...
, HTML("<I>Can</I> <em>this</em> <strong>happen</strong>?")
)
As an aside, you can even use renderText on the server side to build a full HTML output string, which can change, depending on your inputs. I often use this to post automated commentary (e.g. "The latest data release is y.... this is an increase of y, relative to the previous release...").