Fixed the case where HTML that contained entities was being inserted as text strings...
[jquery.git] / src / manipulation.js
index 547acc1..1699f68 100644 (file)
@@ -1,10 +1,10 @@
 var rinlinejQuery = / jQuery\d+="(?:\d+|null)"/g,
        rleadingWhitespace = /^\s+/,
-       rxhtmlTag = /(<(\w+)[^>]*?)\/>/g,
+       rxhtmlTag = /(<([\w:]+)[^>]*?)\/>/g,
        rselfClosing = /^(?:abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i,
-       rtagName = /<(\w+)/,
+       rtagName = /<([\w:]+)/,
        rtbody = /<tbody/i,
-       rhtml = /</,
+       rhtml = /<|&\w+;/,
        fcloseTag = function(all, front, tag){
                return rselfClosing.test(tag) ?
                        all :
@@ -90,6 +90,14 @@ jQuery.fn.extend({
                });
        },
 
+       unwrap: function() {
+               return this.parent().each(function(){
+                       if ( !jQuery.nodeName( this, "body" ) ) {
+                               jQuery( this ).replaceWith( this.childNodes );
+                       }
+               }).end();
+       },
+       
        append: function() {
                return this.domManip(arguments, true, function(elem){
                        if ( this.nodeType === 1 ) {
@@ -325,7 +333,7 @@ jQuery.each({
 jQuery.each({
        // keepData is for internal use only--do not document
        remove: function( selector, keepData ) {
-               if ( !selector || jQuery.multiFilter( selector, [ this ] ).length ) {
+               if ( !selector || jQuery.filter( selector, [ this ] ).length ) {
                        if ( !keepData && this.nodeType === 1 ) {
                                cleanData( this.getElementsByTagName("*") );
                                cleanData( [ this ] );