Skip to content

Commit

Permalink
[GolemBridge] Remove image galleries (#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 Jun 4, 2022
1 parent 8172d10 commit 8865521
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 8865521

Please sign in to comment.