how to convert &#(no); embedded in a string to a string with corresponding character in javascript?
how to convert &#(no); embedded in a string to a string with corresponding character
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Similar for decimal (
&#(\d+);).For entities (
©) you need a look-up table.Why not just directly display the string as HTML anyway? Just strip all the
<and>if you want to avoid XSS.