- From: Rijk van Geijtenbeek <rijk@opera.com>
- Date: Sat, 25 May 2002 00:25:03 +0200
- To: html-tidy@w3.org
25-5-02 0:47:56, Klaus Johannes Rusch <KlausRusch@atmedia.net> schreef: > Rijk van Geijtenbeek <rijk@opera.com> writes: [about a fix for handling SPAN outside block-levbel elements] >> 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 understand now... But I would still like SPAN to be treated exactly like FONT on cleanup. Maybe something can be done with the fact that start tags for SPAN generally have attributes? Like FONT, it is almost never applied just as <SPAN>. >> 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. Fair enough. >Note that not all block elements "absorb" the surrounding inlines, only a few >selected elements like <h1> are treated this way in tidy. And even around LI elements, which is very nice of 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 ... Mozilla and MSIE don't even do this in Standards mode. They should, I agree. But the forgivingness of browsers is one the reasons why Tidy can be so useful... To help repenting sinners, who didn't know they were sinning before they saw the light^H^H^H^H^Hspecs. -- If you don't like having choices | Rijk van Geijtenbeek made for you, you should start | Documentation & QA making your own. - Neal Stephenson | mailto:rijk@opera.com
Received on Friday, 24 May 2002 18:18:35 UTC