creationix / haml-js

Haml ported to server-side Javascript. This is a traditional server-side templating language. Tested with node-js
MIT License
900 stars 109 forks source link

Support :if, :else statements #66

Open betamos opened 12 years ago

betamos commented 12 years ago

I encountered a couple of unexpected behaviors in the :if plugin.

:if foo
  %p This
:else
  %p That

would be a great feature. I understand if it's difficult to implement this in the current parsing logic.

Also :if foo will yield an error if foo is not defined on the object. You need to type something like :if typeof foo != 'undefined' now which is kind of meh.

Thanks for a great template engine.

mahemoff commented 12 years ago

+1 came here to say this.

Thanks also for a great template engine.