diff --git a/scripts/size-report.js b/scripts/size-report.js index e92d53ee3..b6d2a0d6a 100644 --- a/scripts/size-report.js +++ b/scripts/size-report.js @@ -314,6 +314,11 @@ function renderCategoryDetails(report) { for (const category of report.categories) { lines.push(renderCategoryBlock(category, report.hasBaseline)) + lines.push('') + } + + if (report.categories.length > 0) { + lines.pop() } lines.push('') @@ -339,9 +344,11 @@ function renderCategoryBlock(category, hasBaseline) { summaryParts.push('') lines.push(summaryParts.join('')) + lines.push('') if (category.description) { lines.push(`_${category.description}_`) + lines.push('') } if (category.bundles.length === 0) { @@ -382,6 +389,7 @@ function renderCategoryBlock(category, hasBaseline) { }) lines.push(markdownTable([headers, ...rows])) + lines.push('') const statusParts = [] if (category.counts.added) statusParts.push(`${category.counts.added} added`) @@ -393,10 +401,11 @@ function renderCategoryBlock(category, hasBaseline) { statusParts.push(`${category.counts.decreased} shrank`) if (statusParts.length > 0) { - lines.push(`\n_Status:_ ${statusParts.join(' / ')}`) + lines.push(`_Status:_ ${statusParts.join(' / ')}`) + lines.push('') } - lines.push('\n') + lines.push('') return lines.join('\n') }