mirror of
https://github.com/jquery/jquery.git
synced 2024-11-23 02:54:22 +00:00
#6782 - optimized regex to allow more html snippets to user innerHTML
This commit is contained in:
parent
71bd828d9f
commit
00a05ad985
@ -6,6 +6,7 @@ var rinlinejQuery = / jQuery\d+="(?:\d+|null)"/g,
|
||||
rtagName = /<([\w:]+)/,
|
||||
rtbody = /<tbody/i,
|
||||
rhtml = /<|&#?\w+;/,
|
||||
rnoInnerhtml = /<(?:script|style)/i,
|
||||
rnocache = /<(?:script|object|embed|option|style)/i,
|
||||
// checked="checked" or checked
|
||||
rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
|
||||
@ -199,7 +200,7 @@ jQuery.fn.extend({
|
||||
null;
|
||||
|
||||
// See if we can take a shortcut and just use innerHTML
|
||||
} else if ( typeof value === "string" && !rnocache.test( value ) &&
|
||||
} else if ( typeof value === "string" && !rnoInnerhtml.test( value ) &&
|
||||
(jQuery.support.leadingWhitespace || !rleadingWhitespace.test( value )) &&
|
||||
!wrapMap[ (rtagName.exec( value ) || ["", ""])[1].toLowerCase() ] ) {
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user