Replaced format_html with mark_safe/conditional_escape for Django < 1.5 compatibility.