baryshev / ect

Fastest JavaScript template engine with embedded CoffeeScript syntax
http://ectjs.com
MIT License
626 stars 70 forks source link

"Slurp" functionality? #73

Open johanjordaan opened 10 years ago

johanjordaan commented 10 years ago

Hi. I might have missed a document somewhere, but how do I 'slurp' newlines? I have a template like:

<% for x in xes: %> <%= x.name %> <% end %>

Given a list of of xes the template will include extra new lines. I would like the output to be such that there is no newlines.

In EJS I added functionality such that: <% for x in xes: -%> <%= x.name %> <% end -%>

would 'slurp' the newlines. This just makes for neater output.

Does functionality exist to do what I want? If not what is the chances of it being added? I can do it if it makes sense...

Regards Johan

paulyoung commented 10 years ago

I'm finding that I need this too.