Fix for #1086: Append all caps HTML tags

This commit is contained in:
Brandon Aaron 2007-04-25 19:48:00 +00:00
parent 958bed09da
commit 5fae496933
2 changed files with 10 additions and 6 deletions

View File

@ -404,18 +404,18 @@ test("append(String|Element|Array<Element>|jQuery)", function() {
ok( pass, "Test for appending a DOM node to the contents of an IFrame" ); ok( pass, "Test for appending a DOM node to the contents of an IFrame" );
reset();
$('#select1').appendTo('#foo');
t( 'Append select', '#foo select', ['select1'] );
reset(); reset();
$('<fieldset>').appendTo('#form').append('<legend id="legend">test</legend>'); $('<fieldset>').appendTo('#form').append('<legend id="legend">test</legend>');
t( 'Append legend', '#legend', ['legend'] ); t( 'Append legend', '#legend', ['legend'] );
reset();
$('#select1').append('<OPTION>Test</OPTION>');
ok( $('#select1 option:last').text() == "Test", "Appending &lt;OPTION&gt; (all caps)" );
}); });
test("appendTo(String|Element|Array&lt;Element&gt;|jQuery)", function() { test("appendTo(String|Element|Array&lt;Element&gt;|jQuery)", function() {
expect(5); expect(6);
var defaultText = 'Try them out:' var defaultText = 'Try them out:'
$('<b>buga</b>').appendTo('#first'); $('<b>buga</b>').appendTo('#first');
ok( $("#first").text() == defaultText + 'buga', 'Check if text appending works' ); ok( $("#first").text() == defaultText + 'buga', 'Check if text appending works' );
@ -435,6 +435,10 @@ test("appendTo(String|Element|Array&lt;Element&gt;|jQuery)", function() {
expected = "This link has class=\"blog\": Simon Willison's WeblogTry them out:Yahoo"; expected = "This link has class=\"blog\": Simon Willison's WeblogTry them out:Yahoo";
$("#first, #yahoo").appendTo('#sap'); $("#first, #yahoo").appendTo('#sap');
ok( expected == $('#sap').text(), "Check for appending of jQuery object" ); ok( expected == $('#sap').text(), "Check for appending of jQuery object" );
reset();
$('#select1').appendTo('#foo');
t( 'Append select', '#foo select', ['select1'] );
}); });
test("prepend(String|Element|Array&lt;Element&gt;|jQuery)", function() { test("prepend(String|Element|Array&lt;Element&gt;|jQuery)", function() {

View File

@ -1479,7 +1479,7 @@ jQuery.extend({
// Convert html string into DOM nodes // Convert html string into DOM nodes
if ( typeof arg == "string" ) { if ( typeof arg == "string" ) {
// Trim whitespace, otherwise indexOf won't work as expected // Trim whitespace, otherwise indexOf won't work as expected
var s = jQuery.trim(arg), div = doc.createElement("div"), tb = []; var s = jQuery.trim(arg).toLowerCase(), div = doc.createElement("div"), tb = [];
var wrap = var wrap =
// option or optgroup // option or optgroup