I am working on a shinyapp using the leaflet maps. I have been trying to add some popup information, however instead of rendering the HTML as bold, hyperlinks, etc, it just displays the raw text when I click on each point.
Can't be fully certain without having access to your data; but it seems that you are applying htmlEscape function to your labels - in effect making them forget their HTML behaviour, and forcing them to render as text.
Yep, that seems to do it! Thanks!
What exactly does htmlEscape() do, or when should this be used? The leaflet guides were showing this for nearly all the cases.
htmlEscape function does what it says - it sanitizes its input so that it is not rendered as HTML (including any potentially malicious javascript) but as a safe text.
Using it is a best practice in situations where you do not have control over the HTML being rendered (say if it comes from a user input). On the other hand when you do have full control over the HTML input it is not the best idea, as you might want to actually render the HTML - including stuff like links, images and bold / italics font. So context matters.
Note that I am contractually obliged to illustrate the point with this oldish XKCD strip.
I am sorry, but I don't make the rules