Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Broken by multiline conditional #83

Open
agrimm opened this issue Jun 20, 2017 · 0 comments
Open

Broken by multiline conditional #83

agrimm opened this issue Jun 20, 2017 · 0 comments

Comments

@agrimm
Copy link

agrimm commented Jun 20, 2017

Given the following unusual, but seemingly valid, Erb code:

<% foo = 3 %>
<%
  if foo.even?
    foo = foo * 10
  end
%>
<%= foo %>

(which produces "20" if foo is 2)

the following invalid HAML is generated

- foo = 3
- if foo.even?
- foo = foo * 10
- end
= foo

Which generates the following error message:

You don't need to use "- end" in Haml. Un-indent to close a block:
- if foo?
  %strong Foo!
- else
  Not foo.

The html2haml version was as recent as possible:

GIT
  remote: git://github.com/haml/html2haml.git
  revision: 19cb7fff6fe69a9f3576773a9512322e095efe12
  specs:
    html2haml (2.2.0)
      erubis (~> 2.7.0)
      haml (>= 4.0, < 6)
      nokogiri (>= 1.6.0)
      ruby_parser (~> 3.5)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant