Answers for "javascript html encode"

2

javascript html encode

function htmlEntities(s){
	return s.replace(/[\u00A0-\u9999<>\&]/gim, function(i) {
  		return '&#' + i.charCodeAt(0) + ';';
	});
}
Posted by: Guest on February-17-2021
1

javascript html special characters

return mystring.replace(/&/g, "&amp;").replace(/>/g, "&gt;").replace(/</g, "&lt;").replace(/"/g, "&quot;");
Posted by: Guest on June-20-2019
1

jq unencode string

# -r enable raw output

jq -r .[0].string FILE.json
Posted by: Guest on October-09-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language