Skip to content

Commit

Permalink
Minor bugfixes and goreleaser revert (#64)
Browse files Browse the repository at this point in the history
  • Loading branch information
zMoooooritz committed Jan 15, 2024
1 parent f74f9f5 commit 32ad0fa
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 6 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,11 @@ jobs:
with:
go-version: stable
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v4
uses: goreleaser/goreleaser-action@v5
with:
distribution: goreleaser
version: latest
args: release --snapshot --skip-publish --skip-sign --rm-dist
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.PUBLISHER_TOKEN }}

14 changes: 12 additions & 2 deletions pkg/tagesschau/convert.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package tagesschau
import (
"regexp"
"strings"
"unicode"
)

const (
Expand Down Expand Up @@ -44,18 +45,27 @@ func ContentToParagraphs(content []Content) []string {

sec := isSection(text)
if (prevType != c.Type || sec || prevSection) && paragraph != "" || i == len(content)-1 {
paragraphs = append(paragraphs, paragraph)
paragraphs = append(paragraphs, clean(paragraph))
paragraph = ""
}
paragraph += text + " "
prevSection = sec
}
prevType = c.Type
}
paragraphs = append(paragraphs, formatLastLine(paragraph))
paragraphs = append(paragraphs, clean(formatLastLine(paragraph)))
return paragraphs
}

func clean(s string) string {
return strings.Map(func(r rune) rune {
if unicode.IsGraphic(r) {
return r
}
return -1
}, s)
}

func isSection(text string) bool {
return isHighlighted(text, "strong") || isHighlighted(text, "em")
}
Expand Down
8 changes: 6 additions & 2 deletions pkg/tui/keybinds.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,12 @@ func toHelpBinding(binds []string, name string) key.Binding {
)
}

func keybindsToHelpText(keybinds []string) string {
for i := range keybinds {
func keybindsToHelpText(binds []string) string {
keybinds := []string{}

for i := range binds {
keybinds = append(keybinds, binds[i])

if keybinds[i] == "up" {
keybinds[i] = "↑"
}
Expand Down

0 comments on commit 32ad0fa

Please sign in to comment.