Skip to content

Commit

Permalink
fix: incorrect body split (#236)
Browse files Browse the repository at this point in the history
  • Loading branch information
Huliiiiii authored Jul 18, 2024
1 parent 834deaa commit ba73eb3
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions lib/build-commit.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,14 @@ module.exports = (answers, config) => {
addSubject(answers.subject.slice(0, config.subjectLimit));

// Wrap these lines at 100 characters
let body = wrap(answers.body, wrapOptions) || '';
body = addBreaklinesIfNeeded(body, config.breaklineChar);
let body;
if (answers.body) {
body = answers.body;
body = addBreaklinesIfNeeded(body, config.breaklineChar);
body = wrap(body, wrapOptions);
} else {
body = '';
}

const breaking = wrap(answers.breaking, wrapOptions);
const footer = wrap(answers.footer, wrapOptions);
Expand Down

0 comments on commit ba73eb3

Please sign in to comment.