I have a Profile2 page where I want to add some HTML into the page title (I want to insert a fontawesome icon). I am using Display Suite to layout the Profile2 page with a custom view mode.
I have succeeded in over-writing the title using the function hook_profile2_view_alter() and drupal_set_title(), but drupal_set_title() uses check_plain, which strips out all the extra html. I tried using hook_preprocess_page, but there is no title variable available. I think this is because Display Suite takes over the title variable, and renames it as label. I also tried the html_title module without any luck, as I'm pretty sure this is because it only works on nodes and not on entities. I also tried hook_preprocesss_profile2 (having first used mymodule_preprocess_entity(&$variables, $hook) to create the function suggestion), but this function doesn't seem to be running on the page. I'm not sure if this is because I'm using display suite or a custom view mode.
Any help much appreciated, as I seem to be running out of options.