mirror of
https://github.com/jquery/jquery.git
synced 2026-02-02 09:35:09 -05:00
Manipulation: Make an HTML interception point
Fixes gh-1747 Closes gh-2203
This commit is contained in:
@@ -159,6 +159,10 @@ function fixInput( src, dest ) {
|
||||
}
|
||||
|
||||
jQuery.extend({
|
||||
htmlPrefilter: function( html ) {
|
||||
return html.replace( rxhtmlTag, "<$1></$2>" );
|
||||
},
|
||||
|
||||
clone: function( elem, dataAndEvents, deepDataAndEvents ) {
|
||||
var i, l, srcElements, destElements,
|
||||
clone = elem.cloneNode( true ),
|
||||
@@ -230,7 +234,7 @@ jQuery.extend({
|
||||
// Deserialize a standard representation
|
||||
tag = ( rtagName.exec( elem ) || [ "", "" ] )[ 1 ].toLowerCase();
|
||||
wrap = wrapMap[ tag ] || wrapMap._default;
|
||||
tmp.innerHTML = wrap[ 1 ] + elem.replace( rxhtmlTag, "<$1></$2>" ) + wrap[ 2 ];
|
||||
tmp.innerHTML = wrap[ 1 ] + jQuery.htmlPrefilter( elem ) + wrap[ 2 ];
|
||||
|
||||
// Descend through wrappers to the right content
|
||||
j = wrap[ 0 ];
|
||||
@@ -422,7 +426,7 @@ jQuery.fn.extend({
|
||||
if ( typeof value === "string" && !rnoInnerhtml.test( value ) &&
|
||||
!wrapMap[ ( rtagName.exec( value ) || [ "", "" ] )[ 1 ].toLowerCase() ] ) {
|
||||
|
||||
value = value.replace( rxhtmlTag, "<$1></$2>" );
|
||||
value = jQuery.htmlPrefilter( value );
|
||||
|
||||
try {
|
||||
for ( ; i < l; i++ ) {
|
||||
|
||||
Reference in New Issue
Block a user