W3C home > Mailing lists > Public > www-html@w3.org > February 2007

Re: [html] Elements within "title"?

From: Nicholas Shanks <contact@nickshanks.com>
Date: Wed, 28 Feb 2007 21:00:04 +0000
Message-Id: <50FCB9CB-A8C9-4427-8796-E2B77EA21259@nickshanks.com>
To: www-html@w3.org
On 28 Feb 2007, at 15:20, Lachlan Hunt wrote:

> There are legacy documents on the web that include markup  
> significant characters like < and >.

There's nothing wrong with including > in PCDATA. It's only < and &  
that matter.

> Changing the parsing to handle them as markup would break such  
> pages simply because it is different from what browsers do today,  
> and what authors rely on.

Browsers handle entities already, so strings with & in them are not a  
problem, since they will already be broken, HTML5 won't change that.

Browsers don't handle "<text" as meaning an element currently, but  
could conceivably do so if they treated "< a" as CDATA, but "<a  
foo=bar>" as PCDATA. The space and/or closing greater-than sign could  
be defined as significant in how the title is to be handled.

Legacy pages that have markup such as "<title>> C@@L S7uff!!1! <</ 
title>" would still work as the author intended. Pages with titles  
such as "<title>Discussion of the <em> element.</title>" could either  
be updated to use &lt;em> as they should have been doing anyway, or  
the browser can use DOCTYPE switching and heuristics (looking for  
closing tag, say) to decide.
There are few enough of such pages, and their authors savvy enough,  
that I don't feel avoiding breaking such pages is sufficient reason  
to hinder progress of the format. The fix (use &lt;) is so trivial to  
implement that it seems a non-issue here.

I therefore don't see how the arguments against this being possible  
can hold water.
As to whether it should be implemented, well I can see where it would  
be critical: lang attributes on spans as has been cited, usage of  
<sub> and <sup> for scientific purposes. It would ease automatic  
generation of HTML pages from HTML extracts, ease conversion to HTML  
from LaTeX or other formats, and so on.

Indeed I have seen sites in the wild that use tags within their title  
element expecting them to work. These pages could be *fixed* by  
allowing this :-D

- Nicholas.
Received on Wednesday, 28 February 2007 21:01:21 UTC

This archive was generated by hypermail 2.4.0 : Thursday, 30 April 2020 16:21:01 UTC