HTML and Handlebars:(HTML和车把:)
onclick='shareItem("{{name}}")'>
Does not successfully pass a safely escaped name when it has double quotes in it.(当名称中带有双引号时,不会成功传递安全转义的名称。)
onclick="shareItem('{{name}}')">
Does not successfully pass a safely escaped name when it has single quotes in it.(当名称中包含单引号时,不会成功传递安全转义的名称。)
I need to handle both eventualities- and even in the same string.(我需要处理两种情况-甚至在同一字符串中。)
It feels sloppy to have to define a JS variable and pass it to a backslash adder.(必须定义一个JS变量并将其传递给反斜杠加法器感觉很草率。)
Is there a cleaner way to do this with Handlebars or Moustache?(有没有更清洁的方法来使用把手或小胡子呢?)
ask by Kate translate from so
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…