Sha256: 3669f440ba856ed9cf2fe8ac3f17c10866f7f474c801296426e5554dd920965d
Contents?: true
Size: 512 Bytes
Versions: 17
Compression:
Stored size: 512 Bytes
Contents
/*! * escape-html * Copyright(c) 2012-2013 TJ Holowaychuk * MIT Licensed */ /** * Module exports. * @public */ module.exports = escapeHtml; /** * Escape special characters in the given string of html. * * @param {string} str The string to escape for inserting into HTML * @return {string} * @public */ function escapeHtml(html) { return String(html) .replace(/&/g, '&') .replace(/"/g, '"') .replace(/'/g, ''') .replace(/</g, '<') .replace(/>/g, '>'); }
Version data entries
17 entries across 14 versions & 2 rubygems