aboutsummaryrefslogtreecommitdiffhomepage
path: root/reader
diff options
context:
space:
mode:
authorGravatar aniran <aniran.chandravongsri@gmail.com>2018-04-26 16:51:07 -0400
committerGravatar Frédéric Guillot <fred@kanboard.net>2018-04-27 17:57:22 -0700
commit322b265d7aec7731f7fa703c9a74ceb61ae73f3f (patch)
tree01373329a179dd163ce434739bccd6e127ca25a5 /reader
parent920dda79b7d66f30a05aaa03e3fe8dc74aab515b (diff)
Scrape parent element for iframe
Current behavior: if you have an `iframe` scraper rule, `scrapContent` tries to return the inner HTML of the `iframe`, which turns up blank. New behavior: like `img` elements, if an `iframe` is matched by a scraper rule, the parent element's inner HTML (i.e. the `iframe` is returned).
Diffstat (limited to 'reader')
-rw-r--r--reader/scraper/scraper.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/reader/scraper/scraper.go b/reader/scraper/scraper.go
index 4f36d96..b90cc14 100644
--- a/reader/scraper/scraper.go
+++ b/reader/scraper/scraper.go
@@ -72,7 +72,7 @@ func scrapContent(page io.Reader, rules string) (string, error) {
var content string
// For some inline elements, we get the parent.
- if s.Is("img") {
+ if s.Is("img") || s.Is("iframe") {
content, _ = s.Parent().Html()
} else {
content, _ = s.Html()