@@ -55,7 +55,12 @@ describe('hast-util-to-dom', () => {
5555 } ] ,
5656 } ;
5757 const htmlActual = serializeNodeToHtmlString ( toDOM ( tree ) ) ;
58- const htmlExpected = '<!DOCTYPE html><html><head></head><body></body></html>' ;
58+ let htmlExpected = '<!DOCTYPE html><html><head></head><body></body></html>' ;
59+ if ( ! bowser . x ) {
60+ if ( bowser . gecko ) {
61+ htmlExpected = '<!DOCTYPE html>\n<html><head></head><body></body></html>' ;
62+ }
63+ }
5964 expect ( htmlActual ) . toEqual ( htmlExpected ) ;
6065 } ) ;
6166
@@ -108,6 +113,26 @@ describe('hast-util-to-dom', () => {
108113 expect ( htmlActual ) . toEqual ( htmlExpected ) ;
109114 } ) ;
110115
116+ it ( 'handles space-separated attributes correctly' , ( ) => {
117+ const tree = h ( 'div' , { class : [ 'foo' , 'bar' ] } ) ;
118+ const htmlActual = serializeNodeToHtmlString ( toDOM ( tree ) ) ;
119+ const htmlExpected = '<div class="foo bar"></div>' ;
120+ expect ( htmlActual ) . toEqual ( htmlExpected ) ;
121+ } ) ;
122+
123+ it ( 'handles comma-separated attributes correctly' , ( ) => {
124+ const img = 'data:image/gif;base64,R0lGODlhAQABAAAAACwAAAAAAQABAAA=' ;
125+ const tree = h ( 'img' , { srcSet : [ `${ img } 1x` , `${ img } 2x` ] } ) ;
126+ const htmlActual = serializeNodeToHtmlString ( toDOM ( tree ) ) ;
127+ let htmlExpected = `<img srcset="${ img } 1x, ${ img } 2x">` ;
128+ if ( ! bowser . x ) {
129+ if ( bowser . webkit || bowser . blink || bowser . gecko ) {
130+ htmlExpected = `<img srcset="${ img } 1x, ${ img } 2x" />` ;
131+ }
132+ }
133+ expect ( htmlActual ) . toEqual ( htmlExpected ) ;
134+ } ) ;
135+
111136 it ( 'creates a doctype node' , ( ) => {
112137 const tree = {
113138 type : 'doctype' ,
0 commit comments