From e30a8247123ea4bbdf0a582964dfe4ff81aac9f1 Mon Sep 17 00:00:00 2001 From: Andy Mills <61879371+CloudBeard@users.noreply.github.com> Date: Fri, 20 Sep 2024 17:29:17 -0400 Subject: [PATCH] fix: trim whitespace bug (#677) * trim whitespace and fix indention issue from trimming whitespace * ci: trigger label --- src/pkg/common/oscal/component.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/pkg/common/oscal/component.go b/src/pkg/common/oscal/component.go index 5a970cfc..de803e23 100644 --- a/src/pkg/common/oscal/component.go +++ b/src/pkg/common/oscal/component.go @@ -661,10 +661,12 @@ func addPart(part *[]oscalTypes_1_1_2.Part, paramMap map[string]parameter, level } var tabs string - for range level { + // Indents based on labels + for i := 0; i < level; i++ { tabs += "\t" } - prose := part.Prose + // Trims the whitespace + prose := strings.TrimSpace(part.Prose) if prose == "" { result += fmt.Sprintf("%s%s\n", tabs, label) } else if strings.Contains(prose, "{{ insert: param,") {