Skip to content

Commit

Permalink
fix: trim whitespace bug (#677)
Browse files Browse the repository at this point in the history
* trim whitespace and fix indention issue from trimming whitespace

* ci: trigger label
  • Loading branch information
CloudBeard authored Sep 20, 2024
1 parent 643d502 commit e30a824
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/pkg/common/oscal/component.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,") {
Expand Down

0 comments on commit e30a824

Please sign in to comment.