View Single Post
Old 01-29-2003, 07:22 PM   PM User | #12
Algorithm
Regular Coder

 
Join Date: Jul 2002
Location: USA
Posts: 151
Thanks: 0
Thanked 0 Times in 0 Posts
Algorithm is an unknown quantity at this point
This code is an improvement from your original version. However, you still have the 'empty string' bug, wherein an empty string passed as an attribute will instead result in the attribute having no value, which is another thing entirely.
Code:
<input value="" /> <-- Valid
<input value /> <-- Invalid
In fact, as I recall, according to XHTML standards, no attribute should be valueless. My version of your code substitutes the attribute name if no value is supplied.
Code:
<td nowrap> <-- OK, but invalid XHTML
<td nowrap="nowrap"> <-- Valid XHTML, and still read properly by older browsers
Also, I must reiterate that allowing use of the double-quote character would greatly reduce your code's current size. There is no practical use of this code that requires its employment in a link.

Last edited by Algorithm; 01-29-2003 at 07:34 PM..
Algorithm is offline   Reply With Quote