W3C home > Mailing lists > Public > www-html@w3.org > November 1999

Re: HTML comments in <title> elements - valid or not?

From: Dan Connolly <connolly@w3.org>
Date: Mon, 08 Nov 1999 10:35:41 -0600
Message-ID: <3826FBDD.22FBE5D5@w3.org>
To: www-html@w3.org, Arjun Ray <aray@q2.net>
Arjun Ray wrote:
> On Tue, 2 Nov 1999, Sean Richardson wrote:
> > According to <URL:http://www.w3.org/TR/REC-html40/struct/global.html#h-7.4.2>
> > "Titles may contain character entities (for accented characters, special 
> > characters, etc.), but may not contain other markup."
> Yet another place where the 4.0 spec's "friendly prose" fails to state the
> exact requirements.

What's not exact about it? Comments are markup[1]. The spec says don't
any markup except character entities. So the example given:

	<TITLE><!--This title has a comment in it.-->This is the title</TITLE>

doesn't conform to the HTML 4.0 spec.

Perhaps we should have added a NOTE about why this restriction is there:
it's there because older HTML implementations treated <!--...---> as
character data, and I think some versions of the HTML spec declared
the TITLE element as CDATA. So there are known interoperability
so authors are prohibited from going there.

Let's see if I can find the original IETF html-wg discussion of CDATA
vs. PCDATA for TITLE... nope; but reviewing the changes to of
I see that TITLE was RCDATA for a while, then changed to %title-content
which could be either CDATA or PCDATA in v1.8, 
date: 1994/04/09 01:02:10. So if you can find html-wg archives from
around there (we have them somewhere at W3C, I think) you'll probably
find it discussed.

[1] http://www.w3.org/MarkUp/SGML/productions.html#prod91

[2] http://www.w3.org/MarkUp/html-spec/html.dtd
(hm... the ,v file isn't available via HTTP. bummer. see:
http://www.w3.org/MarkUp/html-spec/ChangeLog )

p.s. I composed this reply by hand from the archive, so it won't
have the right References: or In-Reply-To: headers. :-{

Dan Connolly, W3C
Received on Monday, 8 November 1999 11:35:52 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 15:05:51 UTC