In React context, htmltools::HTML() is treated as plain text. It should be however possible to make React render the HTML. Two options come to mind:
Insert a div and use its dangerouslySetInnerHTML. This solution has a drawback of creating an additional wrapper div - might be undesirable, if the user wants strict control over the HTML structure.
Parse the HTML with html-react-parser to get a React element and render it.
Note: A workaround for now is to add a uiOutput() in place of HTML() and render the desired HTML dynamically.
In React context,
htmltools::HTML()
is treated as plain text. It should be however possible to make React render the HTML. Two options come to mind:dangerouslySetInnerHTML
. This solution has a drawback of creating an additional wrapper div - might be undesirable, if the user wants strict control over the HTML structure.html-react-parser
to get a React element and render it.Note: A workaround for now is to add a
uiOutput()
in place ofHTML()
and render the desired HTML dynamically.