Commit 00a05ad9 authored by cmcnulty's avatar cmcnulty

#6782 - optimized regex to allow more html snippets to user innerHTML

parent 71bd828d
...@@ -6,6 +6,7 @@ var rinlinejQuery = / jQuery\d+="(?:\d+|null)"/g, ...@@ -6,6 +6,7 @@ var rinlinejQuery = / jQuery\d+="(?:\d+|null)"/g,
rtagName = /<([\w:]+)/, rtagName = /<([\w:]+)/,
rtbody = /<tbody/i, rtbody = /<tbody/i,
rhtml = /<|&#?\w+;/, rhtml = /<|&#?\w+;/,
rnoInnerhtml = /<(?:script|style)/i,
rnocache = /<(?:script|object|embed|option|style)/i, rnocache = /<(?:script|object|embed|option|style)/i,
// checked="checked" or checked // checked="checked" or checked
rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i, rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
...@@ -199,7 +200,7 @@ jQuery.fn.extend({ ...@@ -199,7 +200,7 @@ jQuery.fn.extend({
null; null;
// See if we can take a shortcut and just use innerHTML // 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 )) && (jQuery.support.leadingWhitespace || !rleadingWhitespace.test( value )) &&
!wrapMap[ (rtagName.exec( value ) || ["", ""])[1].toLowerCase() ] ) { !wrapMap[ (rtagName.exec( value ) || ["", ""])[1].toLowerCase() ] ) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment