File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -460,7 +460,7 @@ export class HTMLElement extends Node {
460
460
return this . _rawAttrs ;
461
461
const attrs = { } as RawAttributes ;
462
462
if ( this . rawAttrs ) {
463
- const re = / \b ( [ a - z ] [ a - z 0 - 9 \- ] * ) (?: \s * = \s * (?: " ( [ ^ " ] + ) " | ' ( [ ^ ' ] + ) ' | ( \S + ) ) ) ? / ig;
463
+ const re = / \b ( [ a - z ] [ a - z 0 - 9 \- ] * ) (?: \s * = \s * (?: " ( [ ^ " ] * ) " | ' ( [ ^ ' ] * ) ' | ( \S + ) ) ) ? / ig;
464
464
let match : RegExpExecArray ;
465
465
while ( match = re . exec ( this . rawAttrs ) ) {
466
466
attrs [ match [ 1 ] ] = match [ 2 ] || match [ 3 ] || match [ 4 ] || "" ;
Original file line number Diff line number Diff line change @@ -264,12 +264,13 @@ describe('HTML Parser', function () {
264
264
265
265
describe ( '#attributes' , function ( ) {
266
266
it ( 'should return attributes of the element' , function ( ) {
267
- var root = parseHTML ( '<p a=12 data-id="!$$&" yAz=\'1\' disabled></p>' ) ;
267
+ var root = parseHTML ( '<p a=12 data-id="!$$&" yAz=\'1\' class="" disabled></p>' ) ;
268
268
root . firstChild . attributes . should . eql ( {
269
269
'a' : '12' ,
270
270
'data-id' : '!$$&' ,
271
271
'yAz' : '1' ,
272
- 'disabled' : ''
272
+ 'disabled' : '' ,
273
+ 'class' : ''
273
274
} ) ;
274
275
} ) ;
275
276
} ) ;
You can’t perform that action at this time.
0 commit comments