我正在使用 Middleman App 和 Handlebars,需要根据 javascript 中的模型解析为, ..之类的%li.name.s{{status}}
东西。这给了我错误:%li.name.s0
%li.name.s1
%script{:type => "text/html", :id => "item"}
{{#items}}
%li.s{{status}}
%a{href: "#"} {{name}}
{{/items}}
这是错误:
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
我猜你不能在类名中有括号。是否有解决方法可以让 Middleman 应用程序忽略?在这些情况下,我宁愿不使用 HTML 编码。