From fb2e233f6ca0a9c387385667664cbd0acf970627 Mon Sep 17 00:00:00 2001 From: Justin Lecher Date: Mon, 3 Apr 2023 11:32:54 +0100 Subject: [PATCH] fix: String additional empty line from generated README.md --- pkg/document/generate.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkg/document/generate.go b/pkg/document/generate.go index 3d85d80..f3208e3 100644 --- a/pkg/document/generate.go +++ b/pkg/document/generate.go @@ -5,6 +5,7 @@ import ( "os" "path/filepath" "regexp" + "strings" "github.com/norwoodj/helm-docs/pkg/helm" log "github.com/sirupsen/logrus" @@ -77,6 +78,7 @@ func applyMarkDownFormat(output bytes.Buffer) bytes.Buffer { re = regexp.MustCompile(`\n{3,}`) outputString = re.ReplaceAllString(outputString, "\n\n") + outputString = strings.TrimSuffix(outputString, "\n") output.Reset() output.WriteString(outputString)