1
0
Fork 0
mirror of https://github.com/miniflux/v2.git synced 2025-08-06 17:41:00 +00:00

refactor(readability): minor clean up

Remove a now-useless regex and its associated test.
This commit is contained in:
jvoisin 2025-07-02 14:42:57 +02:00 committed by Frédéric Guillot
parent 766d4ab834
commit 69a74c4abf
2 changed files with 1 additions and 152 deletions

View file

@ -7,7 +7,6 @@ import (
"fmt"
"io"
"log/slog"
"regexp"
"strings"
"miniflux.app/v2/internal/urllib"
@ -16,13 +15,9 @@ import (
"golang.org/x/net/html"
)
const (
defaultTagsToScore = "section,h2,h3,h4,h5,h6,p,td,pre,div"
)
const defaultTagsToScore = "section,h2,h3,h4,h5,h6,p,td,pre,div"
var (
divToPElementsRegexp = regexp.MustCompile(`(?i)<(?:a|blockquote|dl|div|img|ol|p|pre|table|ul)[ />]`)
strongCandidates = [...]string{"popupbody", "-ad", "g-plus"}
maybeCandidate = [...]string{"and", "article", "body", "column", "main", "shadow"}
unlikelyCandidate = [...]string{"banner", "breadcrumbs", "combx", "comment", "community", "cover-wrap", "disqus", "extra", "foot", "header", "legends", "menu", "modal", "related", "remark", "replies", "rss", "shoutbox", "sidebar", "skyscraper", "social", "sponsor", "supplemental", "ad-break", "agegate", "pagination", "pager", "popup", "yom-remote"}