I would recommend using a filter function.

Something like the following:
s/(<TMPL_IF [^>]*>)\s*/$1/sg;

and 

s/\s*(<\/TMPL_IF>)/$1/sg;

Those two regexes should strip out the whitespace.

Brian

-----Original Message-----
From: Drew Taylor [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 07, 2003 12:09 PM
To: [EMAIL PROTECTED]
Subject: [htmltmpl] Trimming whitespace


In my templates for readability I layout things like:
<TMPL_IF whatever>
Print something here
</TMPL_IF>

Which in the resulting html gives:
<<HTML;

Print something here

HTML

Is there a way to trim the extra whitespace\newlines from the final output? 
I didn't notice anything in the docs so I thought I'd ask here.

Drew
--
Drew Taylor                | Web development & consulting
http://www.drewtaylor.com/ | perl/mod_perl/DBI/mysql/postgres
----------------------------------------------------------------------
Netflix: DVD Rentals by mail with NO late fees or due dates!
Free Trial - http://www.netflix.com/Default?mqso=36126240
----------------------------------------------------------------------



-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
_______________________________________________
Html-template-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/html-template-users

------------------------------------------------------------------------------
This message is intended only for the personal and confidential use of the designated 
recipient(s) named above.  If you are not the intended recipient of this message you 
are hereby notified that any review, dissemination, distribution or copying of this 
message is strictly prohibited.  This communication is for information purposes only 
and should not be regarded as an offer to sell or as a solicitation of an offer to buy 
any financial product, an official confirmation of any transaction, or as an official 
statement of Lehman Brothers.  Email transmission cannot be guaranteed to be secure or 
error-free.  Therefore, we do not represent that this information is complete or 
accurate and it should not be relied upon as such.  All information is subject to 
change without notice.




-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
_______________________________________________
Html-template-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/html-template-users

Reply via email to