Re: About Tidy request 540571

In <ICGA1YC8USSMJIXVHGZJFRQVUP5321.3cee96b4@jol>, Rijk van Geijtenbeek <rijk@opera.com> writes:
> It worked directly, and it looks as is SPAN is now treated like other
> inline elements. I've found one issue though: multiple SPANs.
> 
> Example:
>   <font face="times new roman"><font color=red><p>Paragraph</p>
>   </font></font>
> gets tidied to:
>   <p><font face="times new roman"><font color="red">Paragraph</font>
>   </font></p>
> 
> 
> But
>   <span style="color:#FFFF99;"><span style="background:#FF6600;"><p>
>   Paragraph</p></span></span>
> gets tidied to:
>   <p><span style="color:#FFFF99;">I'll list these two items:</span></p>
> 
> I can only guess why this happens, and maybe this is more difficult to
> solve. Your initial fix is already very useful for me.

This is related to another "feature": multiple instances of most inline
elements are changed to start-end tag pairs, assuming that the author has
mistakenly forgotten the / of the end tag, for example

   <u>underline<u>

does not make sense -- for <span> multiple elements may be intentional
but this is more difficult to fix.

> I found some other issues with fixing faulty inline elements outside
> block-level elements, not specific for SPAN.
> 
> <i><h1>Header</h1>
> <p>Paragraph</p></i>

This is actually intentional, since there is no way to determine when the <i> 
should end the following block element is assumed, even though browsers may 
render this differently.  This is unlikely to change as long as we don't move 
to a different parsing/fixup model with multiple processing phases.

Note that not all block elements "absorb" the surrounding inlines, only a few 
selected elements like <h1> are treated this way in tidy.

> BTW, Opera considers such inline elements closed when the H1 element
> starts. Only SPAN and FONT are handled by Opera in the forgiving way, just
> like MSIE and Mozilla do for all inline elements.

I would think that browser vendors should consider the inline element closed as
soon as a block element is encountered ...

-- 
Klaus Johannes Rusch
KlausRusch@atmedia.net
http://www.atmedia.net/KlausRusch/

Received on Monday, 10 June 2002 17:40:03 UTC