Re: [html] Elements within "title"?

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