[ScmbBridge] Remove "read more" text only if it exists (#2368)

This commit is contained in:
dag 2021-12-16 06:06:52 +01:00 committed by GitHub
parent 28db707587
commit 814711e3af
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -18,7 +18,10 @@ class ScmbBridge extends BridgeAbstract {
$item['title'] = $article->find('header h1 a', 0)->innertext;
// remove text "En savoir plus" from anecdote content
$article->find('span.read-more', 0)->outertext = '';
$readMoreButton = $article->find('span.read-more', 0);
if ($readMoreButton) {
$readMoreButton->outertext = '';
}
$content = $article->find('p.summary a', 0)->innertext;
// remove superfluous spaces at the end