Thanks for the additional insight.

Dave Land wrote:
On Dec 1, 2009, at 7:05 PM, Tony Mechelynck wrote
On 06/11/09 17:50, Ben Fritz wrote:
    
On Nov 6, 10:34 am, Ben Fritz<[email protected]>  wrote:
      
Incidentally, your example html may need some attention. Have you
validated your markup? I don't remember if html requires it, but at
the very least it's good practice (and required by xhtml) to quote  
all
your attribute values, like this:

<tr><td><code><a "href="" class="moz-txt-link-freetext" href="http://www.somesite.com/directoy">http://www.somesite.com/directoy"
style="text-decoration:none">description</a>
</code></td><td>quanity</td></tr>
        
Whoops, like this:

<tr><td><code><a href="" class="moz-txt-link-rfc2396E" href="http://www.somesite.com/directoy">"http://www.somesite.com/directoy"
style="text-decoration:none">description</a>
</code></td><td>quanity</td></tr>
      
In non-X HTML, quotes are not necessary unless you want to include
spaces etc.
    

But they're ALWAYS advisable, or you can run into some *very* hard-
to-diagnose bugs.

This page <http://www.cs.tut.fi/~jkorpela/qattr.html> tells why. For
example, the following chunk of HTML validates, even though it is
manifestly wrong:

<a href=""
<img alt="Yucca" src="" aling=right></a>
<a href=""

More amazing, the fact that it validates is _not_ a bug in the
validator, but is because of the little-known "SHORTTAG" feature of
HTML, which (if it was supported *at all* in browsers) would allow
you to write this:

<em/foo/ instead of <em>foo</em>

It's kind of the ultimate version of self-closing tags.

As a result of it, the little chunk of HTML above, in the eyes of
the validator (which, because it is NOT a browser, so it follows
ALL of the arcane rules of HTML), is equivalent to this:

<a href=""
<img alt="Yucca" src="" aling=right>
<a href=""

Which is clearly not what was intended. Quoting the attributes would
have allowed the validator to notice that the "align" attribute is
misspelled.

Bottom line: quote your attributes. The time you save leaving out
the quotes won't be worth it.

Dave

  

--
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php

Reply via email to