mirror of https://github.com/lukechilds/node.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
379 B
23 lines
379 B
13 years ago
|
|
||
|
/*!
|
||
|
* EJS
|
||
|
* Copyright(c) 2010 TJ Holowaychuk <tj@vision-media.ca>
|
||
|
* MIT Licensed
|
||
|
*/
|
||
|
|
||
|
/**
|
||
|
* Escape the given string of `html`.
|
||
|
*
|
||
|
* @param {String} html
|
||
|
* @return {String}
|
||
|
* @api private
|
||
|
*/
|
||
|
|
||
|
exports.escape = function(html){
|
||
|
return String(html)
|
||
|
.replace(/&(?!\w+;)/g, '&')
|
||
|
.replace(/</g, '<')
|
||
|
.replace(/>/g, '>')
|
||
|
.replace(/"/g, '"');
|
||
|
};
|
||
|
|