sstephenson / eco

Embedded CoffeeScript templates
MIT License
1.71k stars 70 forks source link

No multiline blocks? #13

Closed akidee closed 13 years ago

akidee commented 13 years ago
<%- @views.html({
    body: body()
    title: 'xyz'
    css: [ '/static/css/global.css', '/static/css/index.css' ]
}) %>

Result:

Parse error on line 34: unexpected newline in code block
sstephenson commented 13 years ago

Correct... CoffeeScript's indentation rules make it hard to support multiline expressions in Eco.

But I admit I haven't tried implementing it, so feel free to take a shot at it if you're feeling adventurous.

By the way, that line can be written without the parens and braces like this:

<%- @views.html body: body(), title: 'xyz', css: ['/static/css/global.css', '/static/css/index.css'] %>