Fix potentially unsafe uses of html_safe