1
0
Fork 0
mirror of https://github.com/miniflux/v2.git synced 2025-06-27 16:36:00 +00:00

Add rewrite rule to remove dom elements

This commit is contained in:
Lukas Dietrich 2021-09-01 23:42:23 +02:00 committed by fguillot
parent 9fbcfc213b
commit 93596c1218
3 changed files with 112 additions and 38 deletions

View file

@ -229,3 +229,15 @@ func replaceCustom(entryContent string, searchTerm string, replaceTerm string) s
}
return entryContent
}
func removeCustom(entryContent string, selector string) string {
doc, err := goquery.NewDocumentFromReader(strings.NewReader(entryContent))
if err != nil {
return entryContent
}
doc.Find(selector).Remove()
output, _ := doc.Find("body").First().Html()
return output
}