diff --git a/src/Readability.php b/src/Readability.php index 7b7eed6b..e7be4e45 100644 --- a/src/Readability.php +++ b/src/Readability.php @@ -522,7 +522,17 @@ private function getArticleTitle() $hOnes = $this->dom->getElementsByTagName('h1'); if ($hOnes->length === 1) { - $curTitle = $hOnes->item(0)->nodeValue; + $header = $hOnes->item(0); + + try { + foreach ($header->getElementsByTagName('*') as $element) { + $header->removeChild($element); + } + } catch (\Exception $e) { + } + + $curTitle = $header->nodeValue; + $this->logger->info(sprintf('[Metadata] Using title from an H1 node: \'%s\'', $curTitle)); } }