From 7821ef8e56d8a99a602f13238820503041e32816 Mon Sep 17 00:00:00 2001
From: Christoph Witzko <github@christophwitzko.com>
Date: Sat, 14 Jan 2023 14:42:10 +0100
Subject: [PATCH] refactor: add newline in AppendContent function

---
 pkg/generator/changelog_generator.go | 4 ++--
 pkg/generator/changelog_types.go     | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/pkg/generator/changelog_generator.go b/pkg/generator/changelog_generator.go
index b2772a6..86e1564 100644
--- a/pkg/generator/changelog_generator.go
+++ b/pkg/generator/changelog_generator.go
@@ -21,7 +21,7 @@ func formatCommit(c *semrel.Commit) string {
 	if c.Scope != "" {
 		ret += fmt.Sprintf("**%s:** ", c.Scope)
 	}
-	ret += fmt.Sprintf("%s (%s)\n", c.Message, trimSHA(c.SHA))
+	ret += fmt.Sprintf("%s (%s)", c.Message, trimSHA(c.SHA))
 	return ret
 }
 
@@ -61,7 +61,7 @@ func (g *DefaultChangelogGenerator) Generate(changelogConfig *generator.Changelo
 			break
 		}
 		if commit.Change != nil && commit.Change.Major {
-			bc := fmt.Sprintf("%s```\n%s\n```\n", formatCommit(commit), strings.Join(commit.Raw[1:], "\n"))
+			bc := fmt.Sprintf("%s\n```\n%s\n```", formatCommit(commit), strings.Join(commit.Raw[1:], "\n"))
 			clTypes.AppendContent("%%bc%%", bc)
 			continue
 		}
diff --git a/pkg/generator/changelog_types.go b/pkg/generator/changelog_types.go
index 4ea54e7..c2828f0 100644
--- a/pkg/generator/changelog_types.go
+++ b/pkg/generator/changelog_types.go
@@ -18,14 +18,14 @@ func NewChangelogTypes() ChangelogTypes {
 func (ct *ChangelogTypes) AppendContent(cType, content string) {
 	for i, cct := range *ct {
 		if cct.Type == cType {
-			(*ct)[i].Content += content
+			(*ct)[i].Content += content + "\n"
 			return
 		}
 	}
 	*ct = append(*ct, ChangelogType{
 		Type:    cType,
 		Text:    cType,
-		Content: content,
+		Content: content + "\n",
 	})
 }
 
-- 
GitLab