[Zope] rendering of html

hans hans@beehive.de
Mon, 11 Feb 2002 10:44:26 +0000


Milos Prudek wrote:

> > Feel free to tell me this is a stupid idea, but for sake of clean
> > sources after rendering a page in Zope, could it be possible to indent
> > the contents of a var statement? Observe:
>  >
> > Is this totally useless or do I miss something?
>
> Just the opposite might be useful. Zope Documents and methods should
> include an option to strip all whitespace from the left in rendered HTML.
>
> Not only would it cut download time, but it could prevent a mishap I
> suffered recently:
>
> <td>
>    <a href="/some/place">
>       <img src="someImage">
>       <...a lot of DTML code here>
>    </a>
>    <...a lot of DTML code here>
> </td>
>
> This renders additional 1 milimeter whitespace on image bottom, making
> it impossible to have two tighthly aligned tables. The only solution is
> reformat the code like this:
>
> <td>
>    <a href="/some/place">
>       <img src="someImage">
>       <...a lot of DTML code here></a><...a lot of DTML code here></td>
>
> I do not know if this is browser quirk or HTML standard, but for both
> Mozilla 0.9.8 and MSIE 5.5 the additional whitespace gets created unless
> </a>, <img src> and </td>  sit tight together on a single line.
>
> Imagine a tag called <dtml-tighthtml> </dtml-tighthtml>. When you
> embrace a piece of code with such tag, Zope would render everything as a
> single line.

well, inside dtml-tags white space including line breaks is legal,
same for html.
therefore
<a href="...."
><dtml-something
><img src="..."
><dtml-lots of code here
></a>
i admit, this layout is not the layout i want.