diff --git a/jquery.restable.js b/jquery.restable.js index fe64b82..c523f90 100755 --- a/jquery.restable.js +++ b/jquery.restable.js @@ -41,7 +41,11 @@ if (s.rowHeaders) { if (!$result[value]) { $result[value] = {}; } - $result[value][$row.children('td:nth-child(1)').text()] = $row.children('td:nth-child(' + (index + 1) + ')').text(); + if(s.keepHtml) { + $result[value][$row.children('td:nth-child(1)').html()] = $row.children('td:nth-child(' + (index + 1) + ')').html(); + } else { + $result[value][$row.children('td:nth-child(1)').text()] = $row.children('td:nth-child(' + (index + 1) + ')').text(); + } } else { if (!$result[$row_number]) { $result[$row_number] = {}; } if (s.keepHtml){ diff --git a/jquery.restable.min.js b/jquery.restable.min.js index 8e1e79a..a991c31 100755 --- a/jquery.restable.min.js +++ b/jquery.restable.min.js @@ -4,4 +4,4 @@ * @link http://codeb.it/restable/ * @license MIT */ -!function(t,e,n){"use strict";t.fn.ReStable=function(i){function a(e,n){var i,a=[],h={},c=t(e).find("tr").first().children("td,th"),l=0;return s.rowHeaders&&(c=c.slice(1)),c.each(function(){a.push(t(this).text())}),t(e).find("tr").slice(1).each(function(){var e=t(this);l+=1,t.each(a,function(t,n){t+=1,s.rowHeaders?(h[n]||(h[n]={}),h[n][e.children("td:nth-child(1)").text()]=e.children("td:nth-child("+(t+1)+")").text()):(h[l]||(h[l]={}),h[l][n]=s.keepHtml?e.children("td:nth-child("+t+")").html():e.children("td:nth-child("+t+")").text())})}),i=t("