HTML-safe strings in Handlebars

by Kasper Tidemann

Quite often, you may find yourself working with JavaScript strings containing HTML. If you output these in Handlebars using the normal double-bracketed notation, a string containing Hello there!<br />Good to see you. will be output as just that:

Hello there!<br />Good to see you.

In order to insert the actual HTML, use the triple-bracketed option {{{someString}}}. This results in:

Hello there!
Good to see you.

In short: easy and convenient.