File tree Expand file tree Collapse file tree 4 files changed +55
-28
lines changed Expand file tree Collapse file tree 4 files changed +55
-28
lines changed Original file line number Diff line number Diff line change 7777 function startTagForHandler ( handler ) {
7878 var customStartTagAttrs ;
7979
80- var startTagAttrs = new RegExp (
81- '(?:\\s*[\\w:\\.-]+'
82- + '(?:\\s*'
83- + '(?:' + joinSingleAttrAssigns ( handler ) + ')'
84- + '\\s*(?:(?:"[^"]*")|(?:\'[^\']*\')|[^>\\s]+)'
85- + ')?'
86- + ')*'
80+ var startTagAttr = new RegExp (
81+ '[\\w:\\.-]+'
82+ + '(?:\\s*'
83+ + '(?:' + joinSingleAttrAssigns ( handler ) + ')'
84+ + '\\s*(?:"[^"]*"+?|\'[^\']*\'+?|[^>\\s"\']+?)'
85+ + ')?'
8786 ) ;
8887
8988 if ( handler . customAttrSurround ) {
9089 var attrClauses = [ ] ;
9190
9291 for ( var i = handler . customAttrSurround . length - 1 ; i >= 0 ; i -- ) {
9392 // Capture the custom attribute opening and closing markup surrounding the standard attribute rules
94- attrClauses [ i ] = '(?:\\s* '
93+ attrClauses [ i ] = '(?:'
9594 + handler . customAttrSurround [ i ] [ 0 ] . source
9695 + '\\s*'
97- + startTagAttrs . source
96+ + startTagAttr . source
9897 + '\\s*'
9998 + handler . customAttrSurround [ i ] [ 1 ] . source
10099 + ')' ;
101100 }
102- attrClauses . unshift ( startTagAttrs . source ) ;
101+ attrClauses . unshift ( '(?:' + startTagAttr . source + ')' ) ;
103102
104103 customStartTagAttrs = new RegExp (
105- '((?:' + attrClauses . join ( '|' ) + ')*)'
104+ '((?:\\s*(?: ' + attrClauses . join ( '|' ) + ') )*)'
106105 ) ;
107106 }
108107 else {
109108 // No custom attribute wrappers specified, so just capture the standard attribute rules
110- customStartTagAttrs = new RegExp ( '(' + startTagAttrs . source + ')' ) ;
109+ customStartTagAttrs = new RegExp ( '((?:\\s* ' + startTagAttr . source + ')* )' ) ;
111110 }
112111
113112 return new RegExp ( startTagOpen . source + customStartTagAttrs . source + startTagClose . source ) ;
You can’t perform that action at this time.
0 commit comments