Re: Cheetah filter empty new lines

Tavis Rudd <[email protected]> Tue, 26 Jan 2010 17:01:18 -0800 (PST)
Newsgroups gmane.comp.python.cheetah
Message-ID <alpine.LNX.2.00.1001261657561.28908@o2>
Mark,
If you're using a wsgi server you could also handle that in middleware 
with regex replacements or with lxml.

Also remember the #slurp directive if you only need to do remove a newline 
or two from a short section of a template
Tavis

On Tue, 26 Jan 2010, R. Tyler Ballance wrote:

>
> On Tue, 26 Jan 2010, [email protected] wrote:
>
>> is it possible to strip out empty new lines from cheetah when
>>
>> #filter StripEmptyNewlines
>> html...
>> #end filter
>
> You could very easily write a Cheetah.Filters.Filter subclass to do that
>
>
>    class StripEmptyNewLines(Cheetah.Filters.Filter):
>        def filter(self, value, **kwargs):
>            # Do work here
>
>
>> does anyone know a way to do this or is it part of the standard cheetah
>> filter library
>
> Nothing exists in the standard Cheetah install that does this
>
> Cheers,
> -R. Tyler Ballance
> --------------------------------------
> Jabber: [email protected]
> GitHub: http://github.com/rtyler
> Twitter: http://twitter.com/agentdero
>   Blog: http://unethicalblogger.com
>
>

------------------------------------------------------------------------------
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com