Drupal 7: page title contains EM tags when editing node
26 Dec, 2014 Stephan 2 Comments

Using Drupal 7, Page Title 7.x-2.7.
When editing a node, the page title for this post would be:
Edit Blog entry Drupal 7: page title contains EM tags when editing node
With the page title module the <em>
tags are part of the <title>
tags:
<title><em>Edit Blog entry</em> Drupal 7: page title contains EM tags when editing node</title>
This was also reported on Drupal. Since I have the same issue, and the issue is still present in the latest dev version (October 2, 2014), I opted to add a line to the HTML preprocessor in template.php
using strip_tags()
:
<?php
function MYTHEME_preprocess_html(&$vars) {
// Strip HTML tags from title
$vars['head_title'] = strip_tags($vars['head_title']);
}
?>
Problem solved.
Note: If you are using Meta Tags there really is no reason to use Page Title.
Comments
I use css to make it look like span
h2 em {font-style:normal;color:#999}
That works. But there was a problem with the module code; the markup shouldn't have been there. (At the time of writing I was already there panning to uninstall the page title module.)