Skip to content

Commit

Permalink
[ScmbBridge] Remove "read more" text only if it exists (#2368)
Browse files Browse the repository at this point in the history
  • Loading branch information
dvikan authored Dec 16, 2021
1 parent 28db707 commit 814711e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion bridges/ScmbBridge.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ public function collectData(){
$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
Expand Down

0 comments on commit 814711e

Please sign in to comment.