Handlebars specific - escape both single and double quotes when passing Handlebars expression

后端 未结 2 1183
陌清茗
陌清茗 2021-02-07 05:42

HTML and Handlebars:

onclick=\'shareItem(\"{{name}}\")\'> 

Does not successfully pass a safely escaped name when it has double quotes in it

2条回答
  •  迷失自我
    2021-02-07 05:46

    I have a problem trying to escape single quotes, and I use the helper that handleblars provide, you can use triple brackets {{{ variable }}} for escape

提交回复
热议问题