When viewing the web page for a specific blog entry, the contents of the “Title” field are also used as the window title for the web browser window.
The problem with this is that, while HTML code can be used to format certain words in blog entry titles, such code is not allowed in window titles, according to the W3C spec:
http://www.w3.org/TR/html4/struct/global.html#h-7.4.2:
I realize that at least some people will recommend against using any code in the “Title” field, but I don’t see why we should be so backward about it, when using inline tags in headings is perfectly correct in HTML 4.
My question is: Is there a way to automatically remove such code from the contents of the “Title” field when using it as window title?
Right now, I am using
<?php show_field($id,"title"); ?>
in my HTML file for a single entry page, and obviously pMachine replaces this with the full contents of the “Title” field, including whatever HTML code I might have used.
I know that there is already something that strips HTML code from blog entries when displaying them in the “Recent Comments” hack that I use with pMachine. But I don’t know enough about PHP to know whether this could be used here as well, and how.
TIA
