File "escapeHTML.js"
Full Path: /home/amervokv/ecomlive.net/wp-content/plugins/webp-express/lib/options/js/escapeHTML.js
File size: 744 bytes
MIME-type: text/plain
Charset: utf-8
/*
function htmlEscape(str) {
return str
.replace(/&/g, '&')
.replace(/"/g, '"')
.replace(/'/g, ''')
.replace(/</g, '<')
.replace(/>/g, '>');
}
*/
function webpexpress_escapeHTML(s)
{
return s.replace(/./gm, function(s) {
var safe = /[0-9a-zA-Z\!]/;
if (safe.test(s.charAt(0))) {
return s.charAt(0);
}
switch (s.charAt(0)) {
case '*':
case '#':
case ' ':
case '{':
case '}':
case ':':
case '.':
case '`':
return s.charAt(0);
default:
return "&#" + s.charCodeAt(0) + ";";
}
});
}