Reputation: 729
For instance, you can see {{{body}}}
and in the templates, you are able to do something like {{data.page.hero.text}}
Is there any significant difference we should be aware of?
Upvotes: 23
Views: 20927
Reputation: 523
Handlebars HTML-escapes values returned by a {{expression}}. If you don't want Handlebars to escape a value, use the "triple-stash", {{{.
Reference: https://handlebarsjs.com/guide/expressions.html#html-escaping
Upvotes: 28
Reputation: 731
Depending on your use case and logic, you may add an option "noEscape" set to true when compiling the template if you want to use {{ }} when {{{ }}} are required to successfully replace the templates. For example: replacing with JSON values.
From the documentation:
var template = Handlebars.compile('{{foo}}', { noEscape: true });
noEscape: Set to true to not HTML escape any content.
Upvotes: 1