小胡子和哈姆尔
我有这个 haml/mustache 模板:
{{#data}}
ok
{{#items}}
{{#item}}
%b ID: {{id}}
{{/item}}
{{/items}}
{{/data}}
并且我有非法嵌套:在纯文本中嵌套是非法的
错误。
我在 Sinatra 中渲染它
Mustache.render(haml(:index), hash)
I have got this haml/mustache template:
{{#data}}
ok
{{#items}}
{{#item}}
%b ID: {{id}}
{{/item}}
{{/items}}
{{/data}}
And I have got Illegal nesting: nesting within plain text is illegal
Error.
I render it in Sinatra
Mustache.render(haml(:index), hash)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不确定是否使用 Sinatra 渲染,但使用此命令:
此数据文件
example.yml
和模板 (foo.haml.mustache ):
我得到以下结果:
请注意缩进级别*.mustache 文件。希望这对您有帮助。
I'm not sure about rendering with Sinatra, but with this command:
this data file
example.yml
and template (foo.haml.mustache ):
I get following result:
Pls pay attention to indentation level in *.mustache file. Hope this help you.