Html 动态元描述撇号替换为'ASCII值
在myHtml 动态元描述撇号替换为&#x27;ASCII值,html,node.js,mongodb,seo,html-encode,Html,Node.js,Mongodb,Seo,Html Encode,在mymeta-description(动态)中,撇号替换为'当我按CTRL+U/查看源代码时,在谷歌搜索中 <meta name="Description" content="Discover Sonam Kapoor's look in Dolly Ki Doli, Dolly/Madhuri/Priya/Bhagyashree,Red Net Kameez with Patiala,Red Art Silk Patiala Suit,RITIKA SACHD
meta
-description
(动态)中,撇号替换为'代码>当我按CTRL+U/查看源代码时,在谷歌搜索中
<meta name="Description" content="Discover Sonam Kapoor's look in Dolly Ki Doli, Dolly/Madhuri/Priya/Bhagyashree,Red Net Kameez with Patiala,Red Art Silk Patiala Suit,RITIKA SACHDEVA Gold finish"
嗨,我终于用下面的代码解决了它
Handlebars.registerHelper('asciim', function(text) {
text = Handlebars.Utils.escapeExpression(text);
return new Handlebars.SafeString(result);
});
谢谢大家您可以在编译车把模板时使用避免自动HTML转义:
handlebar.compile({{foo}},{noEscape:true})
请注意-如果要呈现任何内容,这将是不安全的。如何插入元描述?