arnaucube
arnaucube/socketioMEANseedPublic Self-hosted repository
socketioMEANseed/server/node_modules/escape-html/index.js
server/node_modules/escape-html/index.jsRaw
 1/**
 2 * Escape special characters in the given string of html.
 3 *
 4 * @param  {String} html
 5 * @return {String}
 6 * @api private
 7 */
 8
 9module.exports = function(html) {
10  return String(html)
11    .replace(/&/g, '&')
12    .replace(/"/g, '"')
13    .replace(/'/g, ''')
14    .replace(/</g, '&lt;')
15    .replace(/>/g, '&gt;');
16}