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)
I'm not sure about rendering with Sinatra, but with this command:
cat example.yml foo.haml.mustache | mustache | haml -e
this data file example.yml
--- data: - items: - item: - id: 1 - id: 2 - id: 3 ---
and template (foo.haml.mustache ):
{{#data}} #ok {{#items}} {{#item}} %b ID: {{id}} {{/item}} {{/items}} {{/data}}
I get following result:
ID: 1 ID: 2 ID: 3
Pls pay attention to indentation level in *.mustache file. Hope this help you.