catch empty descriptions
This commit is contained in:
parent
2f9a23d6d1
commit
6a3c912940
|
@ -88,7 +88,10 @@ class Itch extends Source {
|
|||
$title = trim($this->dom->filter("title")->first()->text());
|
||||
[$game->title, $game->author] = explode(' by ', $title);
|
||||
unset($title);
|
||||
$game->description = trim($this->dom->filter('.formatted_description')->first()->html());
|
||||
$desc = $this->dom->filter('.formatted_description');
|
||||
try {
|
||||
$game->description = trim($desc->first()->html());
|
||||
} catch (\Throwable $e) {}
|
||||
$converter = new Pandoc();
|
||||
$game->description = $converter->convert($game->description, 'html', 'mediawiki');
|
||||
return $game;
|
||||
|
|
Reference in a new issue