haml / html2haml

Convert HTML and HTML+Erb to Haml.
MIT License
259 stars 55 forks source link

Certain tags can break `if`/`else` blocks #65

Open epitron opened 8 years ago

epitron commented 8 years ago

Using html2haml 2.0 on this snippet:

<p>
  <% if condition %>
    <p>
      <ul>
        ul text
      </ul>
      p text
    </p>
    if text
  <% else %>
    else text
  <% end %>
</p>

Outputs this HAML:

%p
  - if condition
    %p
    %ul
      ul text
    p text
if text
- else
  else text

You can see that everything after the <ul> tag is at the wrong level of indentation for some reason. The - else block ends up being broken, causing a syntax error.

Very strange...