diff --git a/src/markdown-renderer.ts b/src/markdown-renderer.ts index ba5f865b..b2cd9074 100644 --- a/src/markdown-renderer.ts +++ b/src/markdown-renderer.ts @@ -23,21 +23,12 @@ export default class MarkdownRenderer { } public renderMarkdown(releases: Release[]) { - let renderedString = releases + let output = releases .map(release => this.renderRelease(release)) .filter(Boolean) - .reduce((previousValue, currentValue, index, array) => { - let finalValue = ""; - finalValue = finalValue.concat(previousValue || ""); - finalValue = finalValue.concat("\n"); - finalValue = finalValue.concat(currentValue || ""); - if (index !== array.length - 1) { - finalValue = finalValue.concat("\n\n"); - } - return finalValue; - }, ""); - - return `${renderedString}`; + .join("\n\n\n"); + + return output ? `\n${output}` : ''; } public renderRelease(release: Release): string | undefined {