Skip to content

Commit 5742e3a

Browse files
committed
add extra line break on tag start to avoid hanging properties
1 parent 12f3d76 commit 5742e3a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/render/src/shared/utils/pretty.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -247,9 +247,9 @@ const prettyNodes = (
247247

248248
const rawTagStart = `${indentation}<${node.name}${propertiesRawString}${node.void ? '/' : ''}>`;
249249
if (rawTagStart.length > maxLineLength) {
250-
let tagStart = `${indentation}<${node.name}`;
250+
let tagStart = `${indentation}<${node.name}${lineBreak}`;
251251
for (const property of node.properties) {
252-
tagStart += `${indentation} ${property.name}=${property.value}${lineBreak}`;
252+
tagStart += `${indentation} ${property.name}=${property.value}${lineBreak}`;
253253
}
254254
tagStart += `${indentation}${node.void ? '/' : ''}>`;
255255
formatted += tagStart;

0 commit comments

Comments
 (0)