Merge branch 'main' into main

This commit is contained in:
lapwat
2025-09-05 18:46:03 +02:00
committed by GitHub
9 changed files with 205 additions and 334 deletions

View File

@@ -147,7 +147,7 @@ func NewChapterFromURL(url, linkName string, configs []*ScrapeConfig, index int,
log.Fatal(err)
}
// init progess bar
// init progress bar
var p progress
if config.Quiet == false {
p = NewProgress(links, name, config.Depth)

View File

@@ -115,12 +115,13 @@ func TestContentImagesOnly(t *testing.T) {
func TestSubChapters(t *testing.T) {
config0 := NewScrapeConfigQuiet()
config0.Selector = ".concrete>article>h2>a"
config1 := NewScrapeConfigQuiet()
c := NewChapterFromURL("https://12factor.net/", "", []*ScrapeConfig{config0, config1}, 0, func(index int, name string) {})
got := len(c.SubChapters())
want := 21
want := 12
if got != want {
t.Errorf("got %v, wanted %v", got, want)