Node.js examples for String:HTML String
Escape HTML by entity map
var __entityMap = { "&": "&", "<": "<", ">": ">", '"': '"', "'": ''', "/": '/' }; String.prototype.escapeHTML = function() { return String(this).replace(/[&<>"'\/]/g, function(s) { return __entityMap[s]; });// www . ja v a 2 s . com }