velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Lynch <peterwly...@yahoo.com>
Subject More Gobbling whitespace...
Date Wed, 04 Jul 2001 01:24:13 GMT
I originally posted this to turbine-user by mistake.
They provided good feedback, but I thought I should
repost to my original intended list for your comments.
Thanks,
-----------------------------------------

Greetings,

To save response size of content delivered
over the web, I am looking for a way to return
templates written like this :

-----8<----------
<html>
<head>



</head>

<body>
    This is tabbed text
  

    <br>
        Here is the next line that starts with
spaces.</body>


    </html>
----8<-----------------

To output to the browser like:

----8<----------------
<html>
<head>
</head>
<body>
This is tabbed text
<br>
Here is the next line that starts with spaces.
</body>
</html>
----8<-------------------The output would be much
cleaner and less readable
using view source and smaller in size to download.
We had an inhouse template parser that had this
functionality.
Is there a way that output generated by velocity can
gobble:
1) leading whitespace, and tabs
2) trim all whitespace and tabs at the end of lines
3) maintain new line characters
4) remove empty lines

all without the various hacks I have seen like using
comment directives at the beginning of lines.
It would be nice to have this be turned on and off via
a property so that developers could always get the
formatted source to help debugging. I realize this may
useful for only
web based templates, but hey it would be very cool
tohave.

Maybe velocity can do this already?

-Peter


__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/

Mime
View raw message