Press n or j to go to the next uncovered block, b, p or k for the previous block.
1 2 3 4 5 6 7 8 9 10 11 | 2x 2x 2x 2x 2x 2x 2x 2x 26x 26x | /** * Tiny HTML escaping function, useful to protect against things like XSS and * unintentionally breaking attributes with quotes. * * @param {String} unescaped - An HTML value, unescaped * @return {String} - An HTML-safe string */ export default function escape(unescaped) { return unescaped.replace(/[&<>]/g, match => `&#${match.charCodeAt(0)};`); } |