Je 2006-01-29 17:12:45 +0000, Randal L. Schwartz skribis:
> >>>>> "Paul" == Paul Makepeace <[EMAIL PROTECTED]> writes:
> 
> Paul> I'm converting some PHP to TT and am having trouble with the extra
> Paul> whitespace that's left behind after TT does its processing. This extra
> Paul> \s+ throws out some HTML renderers like IE.
> 
> Paul> For example,
> 
> Paul> <td>
> Paul> [% IF 1 %]
> Paul>   <img src="foo.jpg">
> Paul> [% END %]
> Paul> </td>
> 
> Paul> the best I can get (with POST_CHOMP and FILTER collapse) is,
> 
> Paul>   <td> <img src="foo.jpg"></td>
> 
> Paul> That extra space between the td and img can damage the rendering.
> 
> Paul> Is there a way to have TT remove this extra whitespace?
> 
> Setting POST_CHOMP to 1 is my favorite, because it *mostly* does the right
> thing.  But it's not psychic, since you put a newline after your initial text.
> Either also set PRE_CHOMP to 1 (which would swallow that, but sometimes it'll
> swallow too much), or leave POST_CHOMP at 1 and write that as:
> 
>     <td>
>     [%- IF 1 %]
>       <img src="foo.jpg">
>     [%- END %]
>     </td>

Hmm, did you actually try this? It didn't work for me, nor is it AIUI
documented to work (although frankly some of the _CHOMP docs were
confusing to some IRC wonks & I who were futzing with this). The TT
engine doesn't seem to mess with stuff outside of its tags.

Paul

-- 
Paul Makepeace .............................. http://paulm.com/inchoate/

"What is a brown derby? Where the heart is."
   -- http://paulm.com/toys/surrealism/

_______________________________________________
templates mailing list
[email protected]
http://lists.template-toolkit.org/mailman/listinfo/templates

Reply via email to