3 * Copyright(c) 2012-2013 TJ Holowaychuk
12 module.exports = escapeHtml;
15 * Escape special characters in the given string of html.
17 * @param {string} str The string to escape for inserting into HTML
22 function escapeHtml(html) {
24 .replace(/&/g, '&')
25 .replace(/"/g, '"')
26 .replace(/'/g, ''')
27 .replace(/</g, '<')
28 .replace(/>/g, '>');