[GolemBridge] Remove image galleries (#2761)

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.
This commit is contained in:
Mynacol 2022-06-04 22:27:24 +02:00 committed by GitHub
parent 8172d10bb5
commit 8865521b3b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -111,12 +111,12 @@ class GolemBridge extends FeedExpander {
$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;
}