diff options
author | 2019-09-17 00:28:41 +0500 | |
---|---|---|
committer | 2019-09-16 21:28:41 +0200 | |
commit | 7f6ca23e8f68bd4d2280a8caff74752437cded6c (patch) | |
tree | 7de1a018b276551192f5343f77488c9b03d4de24 | |
parent | 1daef22a3db3580291011c8e4df5d5494f42ca0b (diff) | |
download | rss-bridge-7f6ca23e8f68bd4d2280a8caff74752437cded6c.tar.gz rss-bridge-7f6ca23e8f68bd4d2280a8caff74752437cded6c.tar.zst rss-bridge-7f6ca23e8f68bd4d2280a8caff74752437cded6c.zip |
[PikabuBridge] Preserve links (#1286)
* [PikabuBridge] Preserve links
-rw-r--r-- | bridges/PikabuBridge.php | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/bridges/PikabuBridge.php b/bridges/PikabuBridge.php index 987070d1..a54f6bf5 100644 --- a/bridges/PikabuBridge.php +++ b/bridges/PikabuBridge.php @@ -110,6 +110,10 @@ class PikabuBridge extends BridgeAbstract { } } $img->outertext = '<img src="' . $src . '">'; + + // it is assumed, that img's parents are links to post itself + // we don't need them + $img->parent()->outertext = $img->outertext; } $categories = array(); @@ -125,7 +129,10 @@ class PikabuBridge extends BridgeAbstract { $item['categories'] = $categories; $item['author'] = $post->find('.user__nick', 0)->innertext; $item['title'] = $title->plaintext; - $item['content'] = strip_tags(backgroundToImg($post->find('.story__content-inner', 0)->innertext), '<br><p><img>'); + $item['content'] = strip_tags( + backgroundToImg($post->find('.story__content-inner', 0)->innertext), + '<br><p><img><a> + '); $item['uri'] = $title->href; $item['timestamp'] = strtotime($time->getAttribute('datetime')); $this->items[] = $item; |