Archived
1
0
Fork 0

catch empty descriptions

This commit is contained in:
Alexander Yakovlev 2018-07-06 08:52:23 +07:00
parent 2f9a23d6d1
commit 6a3c912940

View file

@ -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;