aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Resig <jeresig@gmail.com>2007-08-16 03:35:29 +0000
committerJohn Resig <jeresig@gmail.com>2007-08-16 03:35:29 +0000
commit760a244dbdca7b5a93d147c62ac37ff6eeb9573b (patch)
treed89053c9c2469c46d35aecdb2610b0024401d01a
parentd38ee78db9b8a8a89b985928c1d23543cb2ff1cd (diff)
downloadjquery-760a244dbdca7b5a93d147c62ac37ff6eeb9573b.tar.gz
jquery-760a244dbdca7b5a93d147c62ac37ff6eeb9573b.zip
Added a fix for bug #1489, appending <caption> was broken.
-rw-r--r--src/jquery/coreTest.js6
-rw-r--r--src/jquery/jquery.js2
2 files changed, 6 insertions, 2 deletions
diff --git a/src/jquery/coreTest.js b/src/jquery/coreTest.js
index 905d92a4f..b65877a30 100644
--- a/src/jquery/coreTest.js
+++ b/src/jquery/coreTest.js
@@ -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' );
@@ -418,6 +418,10 @@ test("append(String|Element|Array&lt;Element&gt;|jQuery)", function() {
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>')
.append('<select id="appendSelect2"><option>Test</option></select>');
diff --git a/src/jquery/jquery.js b/src/jquery/jquery.js
index 07588baac..94f099be8 100644
--- a/src/jquery/jquery.js
+++ b/src/jquery/jquery.js
@@ -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") &&