W3C home > Mailing lists > Public > html-tidy@w3.org > January to March 2002

Re: Tags lacking a terminating '>' are spotted

From: Richard A. O'Keefe <ok@atlas.otago.ac.nz>
Date: Thu, 7 Feb 2002 13:24:37 +1300 (NZDT)
Message-Id: <200202070024.NAA330385@atlas.otago.ac.nz>
To: Fred.Bone@dial.pipex.com, html-tidy@w3.org
"Fred Bone" <Fred.Bone@dial.pipex.com> wrote:
	OK, you tell me where to put the > in this:
	
	<td nowrap is a deprecated attribute for table data cell elements ...
	
A simple rule works reasonably well:
    Start with <tag
    while the next tokens are
	<word> =   (any word)
    OR  <word>     (only if word is a known single-enumeration-value
		    attribute name)
	process next attribute
    If /> process empty tag, else
    if > process start tag, else
    insert > and process start tag.
	
The example would become

	<td nowrap> is a deprecated attribute for table data cell elements ...
		  ^
I _think_ the complete list of known single-enumeration-value attributes is
    checked, compact, declare, defer, disabled, ismap, multiple, nohref,
    noresize, noshade, nowrap, readonly, selected.
It's not a long list.  If someone wants to add words to this list for the
sake of their own extra tags, they should declare them explicitly.

Consider the following example:
    <html><body>
    <table>
    <tr>
    <td nowrap  is a deprecated attribute for table data cell elements
    <tr>
    <td compact is not deprecated at all
    </table>
    </body></html>
In Netscape 4.7, that displays as a blank page.
Adopting this little rule, we get
    <html><body>
    <table>
    <tr>
    <td nowrap>  is a deprecated attribute for table data cell elements
    <tr>
    <td compact> is not deprecated at all
    </table>
    </body></html>
which is admittedly missing two words of intended text from the display,
but that's a *huge* improvement over missing _everything_!
Received on Wednesday, 6 February 2002 19:24:45 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 3 April 2012 06:13:51 GMT