Skip to content

Commit

Permalink
Fixed a bug with .append() and <td>/<tr>.
Browse files Browse the repository at this point in the history
  • Loading branch information
jeresig committed Jan 10, 2007
1 parent 6de5275 commit 84ecf39
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/jquery/jquery.js
Expand Up @@ -1355,16 +1355,17 @@ jQuery.extend({

var wrap =
// option or optgroup
!s.indexOf("<opt") && [1, "<select>", "</select>"] ||
!s.indexOf("<opt") &&
[1, "<select>", "</select>"] ||

!s.indexOf("<thead") || !s.indexOf("<tbody") || !s.indexOf("<tfoot") &&
(!s.indexOf("<thead") || !s.indexOf("<tbody") || !s.indexOf("<tfoot")) &&
[1, "<table>", "</table>"] ||

!s.indexOf("<tr") &&
[2, "<table><tbody>", "</tbody></table>"] ||

// <thead> matched above
!s.indexOf("<td") || !s.indexOf("<th") &&
(!s.indexOf("<td") || !s.indexOf("<th")) &&
[3, "<table><tbody><tr>", "</tr></tbody></table>"] ||

[0,"",""];
Expand Down Expand Up @@ -1400,6 +1401,7 @@ jQuery.extend({
r.push( arg );
else
r = jQuery.merge( r, arg );

}

return r;
Expand Down

0 comments on commit 84ecf39

Please sign in to comment.