我正在尝试这样做并使用 Middleman App 构建
%script{:type => "text/html", :id => "showItem"}
{{#items}}
%li
%a{href: "#{{id}}"} {{showName}}
{{/items}}
问题是这条线在另一条线内%a{href: "#{{id}}"}
时{{id}}
{}
这是错误
SyntaxError at /show.html
/show.haml:110: syntax error, unexpected '}', expecting tASSOC ...tributes({}, nil, href: "#{{id}}")}>{{showName}}</a>\n ... ... ^ /show.haml:127: syntax error, unexpected ',', expecting '}' ...script>\n </body>\n</html>\n", -2, false); ... ^ /show.haml:131: syntax error, unexpected keyword_end, expecting '}'
Ruby C:/Ruby193/lib/ruby/gems/1.9.1/gems/tilt-1.3.3/lib/tilt/template.rb: in instance_eval, line 209
Web GET localhost/show.html
有没有办法解决这个问题?因为我需要使用 Handlebars 来解析标签属性中的变量。
谢谢。