Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does `{{{variable}}}` mean in handlebars?

Tags:

What does triple curly braces mean in handlebars template syntax?

For example

{{{variable}}}

I cannot find any documentation.

Thanks

like image 440
MeV Avatar asked Jul 19 '15 00:07

MeV


People also ask

What does variable triple brace meaning in handlebars?

Because it was originally designed to generate HTML, Handlebars escapes values returned by a {{expression}} . If you don't want Handlebars to escape a value, use the "triple-stash", {{{ . Source: https://handlebarsjs.com/guide/#html-escaping.

What is a partial In handlebars?

{{> "partials"}} is a helper for reusing chunks of template code in handlebars files. This can be useful for any repeating elements, such as a post card design, or for splitting out components like a header for easier to manage template files.


1 Answers

Because it was originally designed to generate HTML, Handlebars escapes values returned by a {{expression}}. If you don't want Handlebars to escape a value, use the "triple-stash", {{{.

Source: https://handlebarsjs.com/guide/#html-escaping
Found via: https://github.com/wycats/handlebars-site/issues/28

like image 194
spenibus Avatar answered Oct 02 '22 10:10

spenibus