Skip to content

Commit

Permalink
HTMLDecode was ignoring ' and '
Browse files Browse the repository at this point in the history
  • Loading branch information
ejones committed Oct 25, 2010
1 parent b64c6c0 commit aba1cc2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/jsdom/browser/htmlencoding.js
Expand Up @@ -178,11 +178,12 @@ var html_entity_decode = function(string, quote_style) {
delete(hash_map['&']);
hash_map['&'] = '&';

tmp_str = tmp_str.split(''').join("'");
tmp_str = tmp_str.split(''').join("'");
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;
};
Expand Down Expand Up @@ -221,7 +222,7 @@ var get_html_translation_table = function(table, quote_style) {
constMappingQuoteStyle[3] = 'ENT_QUOTES';

useTable = !isNaN(table) ? constMappingTable[table] : table ? table.toUpperCase() : 'HTML_SPECIALCHARS';
useQuoteStyle = !isNaN(quote_style) ? constMappingQuoteStyle[quote_style] : quote_style ? quote_style.toUpperCase() : 'ENT_COMPAT';
useQuoteStyle = !isNaN(quote_style) ? constMappingQuoteStyle[quote_style] : quote_style ? quote_style.toUpperCase() : 'ENT_QUOTES';

if (useTable !== 'HTML_SPECIALCHARS' && useTable !== 'HTML_ENTITIES') {
throw new Error("Table: "+useTable+' not supported');
Expand Down

0 comments on commit aba1cc2

Please sign in to comment.