File tree Expand file tree Collapse file tree 1 file changed +19
-4
lines changed Expand file tree Collapse file tree 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) {
301301 attrs : { } ,
302302 voidElement : false ,
303303 children : [ ]
304- } , {
305- type : 'text' , content : '\n'
306304 } ] , 'should not explode on trailing whitespace' ) ;
307305
308306 html = '<div>Hi</div> There ' ;
@@ -339,8 +337,6 @@ test('parse', function (t) {
339337 children : [
340338 { type : 'text' , content : 'something' }
341339 ]
342- } , {
343- type : 'text' , content : ' '
344340 } , {
345341 type : 'tag' ,
346342 name : 'a' ,
@@ -351,6 +347,25 @@ test('parse', function (t) {
351347 type : 'text' , content : 'else '
352348 } ] , 'should handle text nodes in the middle of tags at the top-level' ) ;
353349
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' ) ;
354369 t . end ( ) ;
355370} ) ;
356371
You can’t perform that action at this time.
0 commit comments