Skip to content

Commit

Permalink
Fix #295 - avoid trimming info string if nothing to trim
Browse files Browse the repository at this point in the history
  • Loading branch information
dweymouth committed Dec 16, 2023
1 parent 16c4543 commit d10162c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions ui/dialogs/albuminfodialog.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,10 @@ func (a *AlbumInfoDialog) CreateRenderer() fyne.WidgetRenderer {
}

func (a *AlbumInfoDialog) infoLabel(info string) *widget.Label {
last := strings.LastIndex(info, "<a href")
infoWithoutLink := strings.TrimSpace(info[:last])
lbl := widget.NewLabel(infoWithoutLink)
if last := strings.LastIndex(info, "<a href"); last > 0 {
info = strings.TrimSpace(info[:last])
}
lbl := widget.NewLabel(info)
lbl.Wrapping = fyne.TextWrapWord
lbl.Alignment = fyne.TextAlignLeading
return lbl
Expand Down

0 comments on commit d10162c

Please sign in to comment.