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:
parent
30f22fbd78
commit
8e1ed8bef3
8 changed files with 73 additions and 8 deletions
|
@ -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
|
||||
})
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue