@@ -239,6 +239,7 @@ const prettyNodes = (
239
239
lineBreak ,
240
240
) ;
241
241
}
242
+ formatted += lineBreak ;
242
243
} else if ( node . type === 'tag' ) {
243
244
const propertiesRawString = node . properties
244
245
. map ( ( property ) => ` ${ property . name } =${ property . value } ` )
@@ -248,13 +249,16 @@ const prettyNodes = (
248
249
if ( rawTagStart . length > maxLineLength ) {
249
250
let tagStart = `${ indentation } <${ node . name } ` ;
250
251
for ( const property of node . properties ) {
251
- tagStart += `${ indentation } ${ property . name } =${ property . value } ${ lineBreak } ` ;
252
+ tagStart += `${ indentation } ${ property . name } =${ property . value } ${ lineBreak } ` ;
252
253
}
253
254
tagStart += `${ indentation } ${ node . void ? '/' : '' } >` ;
254
255
formatted += tagStart ;
255
256
} else {
256
257
formatted += `${ rawTagStart } ` ;
257
258
}
259
+ if ( node . void ) {
260
+ formatted += lineBreak ;
261
+ }
258
262
259
263
if ( ! node . void ) {
260
264
if ( node . children . length > 0 ) {
@@ -263,13 +267,13 @@ const prettyNodes = (
263
267
options ,
264
268
currentIndentationSize + 2 ,
265
269
) } `;
266
- formatted += `${ lineBreak } ${ indentation } ` ;
270
+ formatted += `${ indentation } ` ;
267
271
}
268
272
269
273
formatted += `</${ node . name } >${ lineBreak } ` ;
270
274
}
271
275
} else if ( node . type === 'declaration' ) {
272
- formatted = `${ indentation } ${ node . content } ${ lineBreak } ` ;
276
+ formatted + = `${ indentation } ${ node . content } ${ lineBreak } ` ;
273
277
}
274
278
}
275
279
return formatted ;
0 commit comments