diff options
| author | Paul Buetow <paul@buetow.org> | 2026-03-11 19:40:27 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-03-11 19:40:27 +0200 |
| commit | 414d18f158df079d6526d88ae7c689c8212d4d65 (patch) | |
| tree | 6be824c73cfb89dc98f3272edcb32550b7642c07 /internal/showcase/rank_history.go | |
| parent | cbc041d05a744d902f71d2fc126b7292620e46b2 (diff) | |
fix(showcase): sanitize malformed showcase summariesv0.15.1
Diffstat (limited to 'internal/showcase/rank_history.go')
| -rw-r--r-- | internal/showcase/rank_history.go | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/internal/showcase/rank_history.go b/internal/showcase/rank_history.go index 92c0c33..434332f 100644 --- a/internal/showcase/rank_history.go +++ b/internal/showcase/rank_history.go @@ -178,11 +178,11 @@ func formatRankHistoryForHeader(history []RepoRankHistory) string { tokens := make([]string, 0, len(history)) for i, point := range history { - spot := fmt.Sprintf("#%d", point.Spot) if point.Spot <= 0 { - spot = "n/a" + continue } + spot := fmt.Sprintf("#%d", point.Spot) if i == 0 { tokens = append(tokens, fmt.Sprintf("%s(%s)", spot, point.Anchor)) continue @@ -190,6 +190,10 @@ func formatRankHistoryForHeader(history []RepoRankHistory) string { tokens = append(tokens, fmt.Sprintf("%s%s(%s)", point.Arrow, spot, point.Anchor)) } + if len(tokens) == 0 { + return "" + } + return " [" + strings.Join(tokens, " ") + "]" } |
