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

Return outer HTML when scraping elements

This commit is contained in:
cinput 2019-12-21 21:18:31 -08:00 committed by Frédéric Guillot
parent 30f22fbd78
commit 8e1ed8bef3
8 changed files with 73 additions and 8 deletions

View file

@ -75,13 +75,7 @@ func scrapContent(page io.Reader, rules string) (string, error) {
document.Find(rules).Each(func(i int, s *goquery.Selection) {
var content string
// For some inline elements, we get the parent.
if s.Is("img") || s.Is("iframe") {
content, _ = s.Parent().Html()
} else {
content, _ = s.Html()
}
content, _ = goquery.OuterHtml(s)
contents += content
})