Skip to content

Commit

Permalink
Self-review feedback from looking at #12749
Browse files Browse the repository at this point in the history
  • Loading branch information
BigLep committed Dec 3, 2024
1 parent 9e485ca commit 6fe3088
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cmd/release/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ func main() {
if err != nil {
return fmt.Errorf("failed to read issue template: %w", err)
}
// Spring used for String contains and Lists
// Sprig used for String contains and Lists
tmpl, err := template.New("issue").Funcs(sprig.FuncMap()).Parse(string(issueTemplate))
if err != nil {
return fmt.Errorf("failed to parse issue template: %w", err)
Expand All @@ -347,6 +347,8 @@ func main() {
// Remove duplicate newlines before headers and list items since the templating leaves a lot extra newlines around.
// Extra newlines are present because go formatting control statements done within HTML comments rather than using {{- -}}.
// HTML comments are used instead so that the template file parses as clean markdown on its own.
// In addition, HTML comments were also required within "ranges" in the template.
// Using HTML comments everywhere keeps things consistent.
re := regexp.MustCompile(`\n\n+([^#*\[\|])`)
issueBody = re.ReplaceAllString(issueBody, "\n$1")

Expand Down

0 comments on commit 6fe3088

Please sign in to comment.