Bug and proposed patch for _fnHtmlDecode function when data ends with "

Bug and proposed patch for _fnHtmlDecode function when data ends with "

jledrogojledrogo Posts: 1Questions: 0Answers: 0
edited September 2013 in TableTools
Hello,

If you use the _fnHtmlDecode of the current version of TableTools.js (Version: 2.1.5) with this set of data :

[code] "TEST"" [/code]

it returns
[code] "TEST" [/code]

instead of
[code] "TEST"" [/code]

I don't think this is a correct behavior for this functionnality.

So I proposed this patch for this function :

[code]
"_fnHtmlDecode": function ( sData )
{
if ( sData.indexOf('&') === -1 )
{
return sData;
}

return $('').html(sData).text();
}
[/code]

(idea from http://stackoverflow.com/questions/10715801/javascript-decoding-html-entities)

Hope it helps.
This discussion has been closed.