Skip to content

Commit

Permalink
QueryEscape markdown badge values for badge creation (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
jitterjuice authored Oct 21, 2022
1 parent bb34e4e commit 879a8e9
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions pkg/output/markdown.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package output

import (
"fmt"
"net/url"
"os"

"github.com/sirupsen/logrus"
Expand Down Expand Up @@ -32,11 +33,11 @@ func Markdown(log *logrus.Logger, changeLogFilePath string, releases []*helm.Rel

for _, release := range releases {

if release.Chart.Deprecated {
f.WriteString(fmt.Sprintf("## %s (DEPRECATED)\n\n", release.Chart.Version))
} else {
f.WriteString(fmt.Sprintf("## %s\n\n", release.Chart.Version))
}
if release.Chart.Deprecated {
f.WriteString(fmt.Sprintf("## %s (DEPRECATED)\n\n", release.Chart.Version))
} else {
f.WriteString(fmt.Sprintf("## %s\n\n", release.Chart.Version))
}

if release.ReleaseDate != nil {
f.WriteString(fmt.Sprintf("**Release date:** %s\n\n", release.ReleaseDate.Format("2006-01-02")))
Expand Down Expand Up @@ -88,5 +89,5 @@ func Markdown(log *logrus.Logger, changeLogFilePath string, releases []*helm.Rel
}

func badge(key, value, icon, style string) string {
return fmt.Sprintf("![%s: %s](https://img.shields.io/static/v1?label=%s&message=%s&color=%s&logo=%s)\n", key, value, key, value, style, icon)
return fmt.Sprintf("![%s: %s](https://img.shields.io/static/v1?label=%s&message=%s&color=%s&logo=%s)\n", key, value, key, url.QueryEscape(value), style, icon)
}

0 comments on commit 879a8e9

Please sign in to comment.