Handlebars, avoid compiling (ignore) part of a template?
Unfortunately, Cyril's answer seems out of date? I found this alternative in the Handlebars documentation on raw blocks:
Raw Blocks
Raw blocks are available for templates needing to handle unprocessed mustache blocks.
{{{{raw-helper}}}}
{{bar}}
{{{{/raw-helper}}}}
will execute the helper raw-helper without interpreting the content.
Handlebars.registerHelper('raw-helper', function(options) {
return options.fn();
});
will render
{{bar}}
Yes I finally found it, it's called ... raw
! :
{% raw %}
<script type="text/x-handlebars-template" id="my-template">
<ul>
{{#each items}}
<li><a href="{{url}}" title="{{title}}">{{display}}</a></li>
{{/each}}
</ul>
</script>
{% endraw %}
Update : After an update of Handlebars, this snipped seems to not work now. I opened a ticket to see how to make it works.