Manipulation: Bring tagname regexes up to spec

Fixes gh-2005
Closes gh-2634
This commit is contained in:
Leonardo Braga
2015-10-07 00:51:23 -04:00
committed by Richard Gibson
parent df822caff0
commit fb9472c7fb
4 changed files with 70 additions and 3 deletions

View File

@@ -1,5 +1,5 @@
define( function() {
// Match a standalone tag
return ( /^<([\w-]+)\s*\/?>(?:<\/\1>|)$/ );
return ( /^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i );
} );

View File

@@ -27,7 +27,7 @@ define( [
dataPriv, dataUser, acceptData, DOMEval ) {
var
rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:-]+)[^>]*)\/>/gi,
rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi,
// Support: IE 10-11, Edge 10240+
// In IE/Edge using regex groups here causes severe slowdowns.

View File

@@ -1,3 +1,3 @@
define( function() {
return ( /<([\w:-]+)/ );
return ( /<([a-z][^\/\0>\x20\t\r\n\f]+)/i );
} );