]> source.dussan.org Git - jquery.git/commitdiff
Added a fix for bug #1489, appending <caption> was broken.
authorJohn Resig <jeresig@gmail.com>
Thu, 16 Aug 2007 03:35:29 +0000 (03:35 +0000)
committerJohn Resig <jeresig@gmail.com>
Thu, 16 Aug 2007 03:35:29 +0000 (03:35 +0000)
src/jquery/coreTest.js
src/jquery/jquery.js

index 905d92a4fb1e8175fef5b8e1f5ff79efca77d6b1..b65877a305b165707b9ad3699317b52b2e0c14f3 100644 (file)
@@ -355,7 +355,7 @@ test("wrap(String|Element)", function() {
 });
 
 test("append(String|Element|Array&lt;Element&gt;|jQuery)", function() {
-       expect(17);
+       expect(18);
        var defaultText = 'Try them out:'
        var result = $('#first').append('<b>buga</b>');
        ok( result.text() == defaultText + 'buga', 'Check if text appending works' );
@@ -417,6 +417,10 @@ test("append(String|Element|Array&lt;Element&gt;|jQuery)", function() {
        $('#table colgroup').append('<col/>');
        ok( $('#table colgroup col').length, "Append col" );
        
+       reset();
+       $('#table').append('<caption></caption>');
+       ok( $('#table caption').length, "Append caption" );
+
        reset();
        $('form:last')
                .append('<select id="appendSelect1"></select>')
index 07588baac23ab8e115a71747cd3fb7e35b79f866..94f099be8958c8a2fa544005f99217daaafb7f86 100644 (file)
@@ -1566,7 +1566,7 @@ jQuery.extend({
                                        !s.indexOf("<leg") &&
                                        [1, "<fieldset>", "</fieldset>"] ||
                                        
-                                       (!s.indexOf("<thead") || !s.indexOf("<tbody") || !s.indexOf("<tfoot") || !s.indexOf("<colg")) &&
+                                       s.match(/^<(thead|tbody|tfoot|colg|cap)/) &&
                                        [1, "<table>", "</table>"] ||
                                        
                                        !s.indexOf("<tr") &&