Re: Parsing: "<" inside tags

On Wed, 06 May 2009 20:49:06 +0200, Ian Hickson <ian@hixie.ch> wrote:

> On Wed, 6 May 2009, Simon Pieters wrote:
>>
>> Maybe the spec should make "<" in unquoted attributes and in attribute
>> names a syntax error in order to catch authoring mistakes like the
>> following:
>>
>>   <div class=foo<p>bar</p></div>
>>
>>
>>   <div class=foo
>>    <p>bar</p>
>>   </div>
>>
>> (Validators would issue other errors for those but they are not so
>> helpful for identifying the actual mistake.)
>
> It's an unfortunate error, but because of the upcoming doc="" attribute I
> don't think we want to require < to be escaped in attributes.

Only *unquoted* attribute values.


>> See http://bugzilla.validator.nu/show_bug.cgi?id=504
>
> Shouldn't the first case say the <p attribute is invalid, thus pointing
> right to the location of the error?

Yes but it's less clear a message than "< in an attribute name. This does not end the tag. Probable cause: Missing > immediately before."

-- 
Simon Pieters
Opera Software

Received on Thursday, 7 May 2009 08:01:48 UTC