Compare commits

..

1 Commits

Author SHA1 Message Date
6fd94854a6 fix(deps): update module github.com/puerkitobio/goquery to v1.10.2
Some checks failed
renovate/artifacts Artifact file update failure
2025-02-13 17:00:56 +00:00
4 changed files with 2 additions and 11 deletions

View File

@ -1,4 +1,4 @@
FROM golang:1.24.2 AS build
FROM golang:1.23.6 AS build
WORKDIR /code
RUN go install github.com/a-h/templ/cmd/templ@latest

View File

@ -58,8 +58,6 @@ type customPerformance struct {
func (s *Song) parseLyrics(doc *goquery.Document) error {
var htmlError error
doc.Find("[class^=LyricsHeader]").Remove()
doc.Find("[data-lyrics-container='true']").Each(func(i int, ss *goquery.Selection) {
h, err := ss.Html()
if err != nil {

2
go.mod
View File

@ -5,7 +5,7 @@ go 1.23
toolchain go1.23.4
require (
github.com/PuerkitoBio/goquery v1.10.3
github.com/PuerkitoBio/goquery v1.10.2
github.com/a-h/templ v0.3.819
github.com/allegro/bigcache/v3 v3.1.0
github.com/gorilla/handlers v1.5.2

View File

@ -4,7 +4,6 @@ import (
"net/http"
"net/http/httptest"
"os"
"strings"
"testing"
"github.com/PuerkitoBio/goquery"
@ -26,7 +25,6 @@ func TestLyrics(t *testing.T) {
func testLyrics(t *testing.T, url string) {
title := "The Silver Seas"
artist := "Catch Yer Own Train"
firstLyricLine := "[Verse 1]"
r, err := http.NewRequest(http.MethodGet, url, nil)
if err != nil {
@ -48,7 +46,6 @@ func testLyrics(t *testing.T, url string) {
docArtist := doc.Find("#metadata-info h1").Text()
docTitle := doc.Find("#metadata-info h2").Text()
docLyrics := doc.Find("#lyrics").Text()
if docTitle != title {
t.Fatalf("expected %q, got %q\n", title, docTitle)
@ -57,8 +54,4 @@ func testLyrics(t *testing.T, url string) {
if docArtist != artist {
t.Fatalf("expected %q, got %q\n", artist, docArtist)
}
if !strings.HasPrefix(docLyrics, firstLyricLine) {
t.Fatalf("expected lyrics to start with %q, got %q\n", firstLyricLine, docLyrics)
}
}