Escape double braces {{ … }} in Mustache template. (templating a template in NodeJS)

后端 未结 6 2237
萌比男神i
萌比男神i 2020-12-05 02:28

I\'m trying to template a template, like below:

{{{
{
  \"name\" : \"{{name}}\",
  \"description\" : \"{{description}}\"
}
}}}

{{{debug this}}}
6条回答
  •  时光取名叫无心
    2020-12-05 03:10

    As described in this Question handlebars doesn't support changing the delimiters. But you can escape the double braces with a backslash like this:

    HTML:

    ... \{{ myHandlbarsVar }} ...
    

提交回复
热议问题