We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c6c6267 commit dcb4723Copy full SHA for dcb4723
src/Parser/Manga/MangaParser.php
@@ -91,11 +91,17 @@ public function getMangaImageURL(): string
91
*/
92
public function getMangaSynopsis(): ?string
93
{
94
- $synopsis = JString::cleanse(
95
- $this->crawler->filterXPath('//meta[@property=\'og:description\']')->attr('content')
96
- );
+ // #justMALThings: anime synopsis is wrapped in <p> whereas it's <span> for manga
+ $node = $this->crawler->filterXPath('//span[@itemprop=\'description\']');
+
97
+ if (!$node->count()) {
98
+ return null;
99
+ }
100
101
+ $synopsis = JString::cleanse($node->html());
102
- return preg_match('~^Looking for information on the manga~', $synopsis) ? null : $synopsis;
103
+ // just in case
104
+ return str_starts_with($synopsis, 'No synopsis information has been added to this title.') ? null : $synopsis;
105
}
106
107
/**
0 commit comments