[whatwg] [WA1] INS/DEL and omitted </p> tags

Ian Hickson wrote:
> On Thu, 24 Nov 2005, Simon Pieters wrote:
>> How should a UA parse the following markup snippet?
>>
>> <p>foo<ins><p>bar</ins>
> 
> It should be parsed as:
> 
>   <p>
>     foo
>     <ins>
>     </ins>
>   </p>
>   <p>
>     bar
>   </p>

That seems insane, the second p element is clearly intended to be within 
the ins element, and thus Mozilla's parsing makes much more sense (it 
also happens to match what an SGML parser would produce for HTML4).

> Note that this is an invalid snippet.

Although, that is error handling behaviour, neither parsing method is 
likely to be what the author actually intended.  It's more likely that 
the author intended something like the following, but didn't realise the 
end-tag for the first <p> element would be required in this case for it 
to work:

<p>foo</p>
<ins><p>bar</p></ins>

Doing that, however, might be more difficult to implement and I know of 
no existing implementations that do.

> Basically, when the parsing section gets written, it'll be written to 
> match the behaviour that the most browsers do.

Generally, for interoperability reasons, I'd agree to just specify what 
browsers actually implement, but I think this is one where sanity should 
win over pre-existing interoperability  and I suggest you go with 
Mozilla's behaviour.

-- 
Lachlan Hunt
http://lachy.id.au/

Received on Friday, 25 November 2005 04:53:54 UTC