function html_entity_decode (string, quote_style) {
// http://kevin.vanzonneveld.net
// + original by: john (http://www.jd-tech.net)
// + input by: ger
// + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
// + revised by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
// + bugfixed by: Onno Marsman
// + improved by: marc andreu
// + revised by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
// + input by: Ratheous
// + bugfixed by: Brett Zamir (http://brett-zamir.me)
// + input by: Nick Kolosov (http://sammy.ru)
// + bugfixed by: Fox
// - depends on: get_html_translation_table
// * example 1: html_entity_decode('Kevin & van Zonneveld');
// * returns 1: 'Kevin & van Zonneveld'
// * example 2: html_entity_decode('<');
// * returns 2: '<'
var hash_map = {},
symbol = '',
tmp_str = '',
entity = '';
tmp_str = string.toString();
if (false === (hash_map = this.get_html_translation_table('HTML_ENTITIES', quote_style))) {
return false;
}
// fix & problem
// http://phpjs.org/functions/get_html_translation_table:416#comment_97660
delete(hash_map['&']);
hash_map['&'] = '&';
for (symbol in hash_map) {
entity = hash_map[symbol];
tmp_str = tmp_str.split(entity).join(symbol);
}
tmp_str = tmp_str.split(''').join("'");
return tmp_str;
}