Skip to content

Commit 63ed515

Browse files
committed
fix: Properly indent multi line body in changelog
1 parent d7dc4dd commit 63ed515

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

index.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -172,9 +172,12 @@ export function generateReleaseNotes(commits) {
172172
const sb = [];
173173
function writeSection(category, title) {
174174
sb.push(`## ${title}\n\n`);
175-
for (let commit of category) {
176-
sb.push(`* **${commit.subject}** (${commit.hash})\n`);
177-
if (commit.body.length) sb.push(` ${commit.body}\n`);
175+
for (let { subject, hash, body } of category) {
176+
sb.push(`* **${subject}** (${hash})\n`);
177+
if (body.length) {
178+
body = body.split(/\r?\n/g).join("\n ");
179+
sb.push(` ${body}\n`);
180+
}
178181
}
179182
sb.push("\n");
180183
}

0 commit comments

Comments
 (0)