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

fix(readability): do not remove elements within code blocks

This commit is contained in:
Frédéric Guillot 2025-06-19 20:56:58 -07:00
parent db49e41acf
commit 00697360e0
2 changed files with 27 additions and 0 deletions

View file

@ -162,6 +162,11 @@ func removeUnlikelyCandidates(document *goquery.Document) {
return
}
// Don't remove elements within code blocks (pre or code tags)
if s.Closest("pre, code").Length() > 0 {
return
}
if class, ok := s.Attr("class"); ok {
if shouldRemove(class) {
s.Remove()