How to escape characters in Handlebars

后端 未结 1 1570
星月不相逢
星月不相逢 2021-01-16 08:48

I have \"name\" variable in the view and I want to display something like this in the rendered HTML:

${Jon}

Right now, my code is like this

1条回答
  •  再見小時候
    2021-01-16 09:14

    You can use the HTML ASCII code:

    { = '{'
    } = '}'
    

    example:

  • {{{item}}}
  • if item = 'apple', then this becomes:

    {apple}

    JSBin example

    0 讨论(0)
提交回复
热议问题