fix readability edge case

This commit is contained in:
nkanaev
2022-11-14 15:11:05 +00:00
parent 56e5625adc
commit e62906e63d
3 changed files with 8 additions and 2 deletions

View File

@@ -6,6 +6,7 @@ package readability
import (
"bytes"
"errors"
"fmt"
"io"
"math"
@@ -59,6 +60,9 @@ func ExtractContent(page io.Reader) (string, error) {
best = body
break
}
if best == nil {
return "", errors.New("failed to extract content")
}
}
//log.Printf("[Readability] TopCandidate: %v", topCandidate)