[Zope] rendering of html
Milos Prudek
milos.prudek@tiscali.cz
Fri, 08 Feb 2002 09:50:31 +0100
> 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.
--
Milos Prudek