Skip to content

Commit

Permalink
[HeiseBridge] Remove lost+found icon
Browse files Browse the repository at this point in the history
Remove the icon visible in l+f articles, e.g.
https://www.heise.de/news/l-f-DISGOMOJI-die-Linux-Malware-die-auf-Emojis-steht-9765024.html

Using a css selector in the form img[alt*="l+f"] was tried, but is not
supported by the used library.
  • Loading branch information
Mynacol committed Jun 16, 2024
1 parent 649dfa7 commit 6cdb11f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions bridges/HeiseBridge.php
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,11 @@ private function addArticleToItem($item, $article)
) {
$element->remove();
}
foreach ($article->find('img') as $element) {
if (str_contains($element->alt, 'l+f')) {
$element->remove();
}
}
// reload html, as remove() is buggy
$article = str_get_html($article->outertext);

Expand Down

0 comments on commit 6cdb11f

Please sign in to comment.