Skip to content
This repository has been archived by the owner on Aug 27, 2022. It is now read-only.

Commit

Permalink
[GolemBridge] Remove image galleries (RSS-Bridge#2761)
Browse files Browse the repository at this point in the history
Do not add all images of the image gallery, but only the preselected one.

Often, the same gallery is used multiple times with different preselected
images. The previous implementation always added all images of the
gallery, cluttering the article. This patch only adds the preselected one.

The no-js link wrapping around the gallery leads to a 403 Forbidden
page, so linking that doesn't work to really support galleries.
  • Loading branch information
Mynacol authored and Kwbmm committed Jun 17, 2022
1 parent 64acc18 commit 9895dca
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions bridges/GolemBridge.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,12 @@ private function extractContent($page) {

$content = $article->find('div.formatted', 0);

// fix image galleries (empty src attribute), additionally full image quality
foreach($content->find('img[data-src-full]') as $img) {
// full image quality
foreach($content->find('img[data-src-full][src*="."]') as $img) {
$img->src = $img->getAttribute('data-src-full');
}

foreach($content->find('p, h1, h3, img') as $element) {
foreach($content->find('p, h1, h3, img[src*="."]') as $element) {
$item .= $element;
}

Expand Down

0 comments on commit 9895dca

Please sign in to comment.