private function convertLinksToText(Element $topNode) { if (!empty($topNode)) { $links = $topNode->find('a'); foreach ($links as $item) { $images = $item->find('img'); if ($images->count() == 0) { $item->replaceWith(new Text(Helper::textNormalise($item->text()))); } } } }