Bug:Fix file validation issue
[vnfsdk/refrepo.git] / vnfmarket / src / main / webapp / vnfmarket / node_modules / finalhandler / node_modules / escape-html / index.js
1 /*!
2  * escape-html
3  * Copyright(c) 2012-2013 TJ Holowaychuk
4  * MIT Licensed
5  */
6
7 /**
8  * Module exports.
9  * @public
10  */
11
12 module.exports = escapeHtml;
13
14 /**
15  * Escape special characters in the given string of html.
16  *
17  * @param  {string} str The string to escape for inserting into HTML
18  * @return {string}
19  * @public
20  */
21
22 function escapeHtml(html) {
23   return String(html)
24     .replace(/&/g, '&')
25     .replace(/"/g, '"')
26     .replace(/'/g, ''')
27     .replace(/</g, '&lt;')
28     .replace(/>/g, '&gt;');
29 }