Re: Tags lacking a terminating '>' are spotted

"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 UTC