nurugger07 / calliope

An elixir haml parser

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Evaluate if/else conditionals

nurugger07 opened this issue · comments

Evaluating if/else conditionals requires compiling a smart script.
Given the following haml:

- if true do
  %p foo
- else
  %p bar

Then is should output the following html:

<p>foo</p>

Give that the EEx syntax for this is:

<%= if true do %>
  <p>foo</p>
<% else %>
  <p>bar</p>
<% end %>

Would it not be more appropriate to use the following:

= if true do
  %p foo
- else
  %p bar

I just figured out the difference between haml's silent script - and calliope's smart script. perhaps I'm my above suggestion is not the correct way to go. I'll withdraw the above suggestion.

Closed with PR #40