Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Simple way to escape curly braces?

Is there a simple way to build a string "{value}" with Handlebars? Perhaps something analogous to:

Handlebars.compile("\{{{var}}\}")({var:"value"})
like image 338
tnunamak Avatar asked Jan 18 '26 22:01

tnunamak


1 Answers

Handlebars support whitespace with the ~ character. The following should work

Handlebars.compile("{ {{~var~}} }")({var:"value"})
like image 150
blessanm86 Avatar answered Jan 21 '26 09:01

blessanm86



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!