File tree 1 file changed +19
-4
lines changed
1 file changed +19
-4
lines changed Original file line number Diff line number Diff line change @@ -301,8 +301,6 @@ test('parse', function (t) {
301
301
attrs : { } ,
302
302
voidElement : false ,
303
303
children : [ ]
304
- } , {
305
- type : 'text' , content : '\n'
306
304
} ] , 'should not explode on trailing whitespace' ) ;
307
305
308
306
html = '<div>Hi</div> There ' ;
@@ -339,8 +337,6 @@ test('parse', function (t) {
339
337
children : [
340
338
{ type : 'text' , content : 'something' }
341
339
]
342
- } , {
343
- type : 'text' , content : ' '
344
340
} , {
345
341
type : 'tag' ,
346
342
name : 'a' ,
@@ -351,6 +347,25 @@ test('parse', function (t) {
351
347
type : 'text' , content : 'else '
352
348
} ] , 'should handle text nodes in the middle of tags at the top-level' ) ;
353
349
350
+ html = '<div>Hi</div>\n\n <span>There</span> \t ' ;
351
+ parsed = HTML . parse ( html ) ;
352
+ t . deepEqual ( parsed , [ {
353
+ type : 'tag' ,
354
+ name : 'div' ,
355
+ attrs : { } ,
356
+ voidElement : false ,
357
+ children : [
358
+ { type : 'text' , content : 'Hi' }
359
+ ]
360
+ } , {
361
+ type : 'tag' ,
362
+ name : 'span' ,
363
+ attrs : { } ,
364
+ voidElement : false ,
365
+ children : [
366
+ { type : 'text' , content : 'There' }
367
+ ]
368
+ } ] , 'should remove text nodes that are nothing but whitespace' ) ;
354
369
t . end ( ) ;
355
370
} ) ;
356
371
You can’t perform that action at this time.
0 commit comments