In my meta
–description
(which is dynamic), the apostrophe is replaced by '
when I do CTRL + U / View source, and in Google Search.
<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"
It should be “sonam kapoor’s” but I have “Sonam Kapoor's”. How to fix this?
I am using node.js, html, mongodb.
I did console.log in index.js and checked it is printing “Sonam Kapoor’s” correctly so fetching from database correctly but in web page view source code it is coming “Sonam Kapoor 's” ASCII value.
2
Answers
Hi finally i solved it using following code
Thanks everybody
You can avoid automatic HTML escaping by using the
noEscape
option when compiling your Handlebars template:Handlebars.compile('{{foo}}', { noEscape: true })
Be warned – this will be insecure if you are rendering any user-generated content.