[ZPT] Why does this cause a page template to be invalid?(longish)

Casey Duncan casey@zope.com
Tue, 19 Mar 2002 16:13:49 -0700


Last I checked, <p> was a block tag:

http://www.w3.org/TR/1998/REC-html40-19980424/sgml/dtd.html#block

-Casey

Geir B=E6kholt wrote:
> Hello seb,=20
>=20
> Monday, March 18, 2002, 13:49:54, you wrote:
>=20
>=20
>>>>Don't know what's going on there, but I reduced it to a simpler test
>>>>case:
>>>>
>>>><p>
>>>>  <div>
>>>>
>>>>  </div>
>>>></p>
>>>>
>>>>If you replace the <div>s with inline elements like <span>s, it works=
;
>>>>if you use block elements like <table>, it doesn't.
>>>>
>=20
>>>Strange thing is that in the 'buggy' state no browser I've tried it in=
 so
>>>far complains, only the PT parser ?!?
>>>
>=20
> sb> Yes, I reckon it's a PT parser bug.  Either way, no browsers are st=
rict
> sb> about XHTML whereas the PT parser could be.  But anyway I don't kno=
w
> sb> much about it so I'll shut up now.
>=20
>=20
> The parser is behaving correct in this example (no bug), and the HTML
> in the example is broken. This has nothing to do with it being strict o=
r XHTML
> at all. The above is illegal markup , at least for HTML4.0 and later
> (my guess is that it is illegal in all versions of HTML)...
>=20
>>From the HTML4.0 Specification:
> http://www.w3.org/TR/1998/REC-html40-19980424/struct/global.html#h-7.5.=
3
>=20
> Quote:
> """
> Content model
> Generally, block-level elements may contain inline elements and
> other block-level elements. Generally, inline elements may
> contain only data and other inline elements. Inherent in this
> structural distinction is the idea that block elements create "larger"
> structures than inline elements.
> """
>=20
> IMHO the parser should not behave in erroneous ways , even though most
> browsers do so, and is showing correct behavior. I am incredibly happy
> that someone finally made a templating system that keeps your HTML
> proper. The web really needs this (there is really a lot of crap
> out there...)
>=20
> :-)
>=20
> - oh , and that spec mentioned above - really makes for good reading
> ;-)
>=20
>=20
>=20