Pour utiliser format_html() il faut utiliser la bonne syntaxe :
format_html()
format_html("<em>{}</em>", var)