Question

I am using Middleman App and Handlebars and need %li.name.s{{status}} to be parsed to something like %li.name.s0, %li.name.s1.. based on a model in javascript. This gave me error:

%script{:type => "text/html", :id => "item"}
  {{#items}}
  %li.s{{status}}
    %a{href: "#"} {{name}}
  {{/items}}

Here is the error:

SyntaxError at /test.html
test.haml:217: syntax error, unexpected '}', expecting tASSOC ...lass"=>"name s"}, nil, {status})}>\n <a#{_hamlout.adj... ... ^

Ruby    C:/Ruby193/lib/ruby/gems/1.9.1/gems/tilt-1.3.3/lib/tilt/template.rb: in class_eval, line 233
Web GET localhost/show.html

I guess you can't have brackets in classname. Is there a workaround for this to make Middleman app to ignore? I rather not code in HTML in those cases.

Was it helpful?

Solution

The workaround is this %li.name{class: "s{{status}}"}

This would avoid using classname directly

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top