Skip to content

Commit

Permalink
minor fix on html cleaner
Browse files Browse the repository at this point in the history
  • Loading branch information
panakour committed Mar 7, 2020
1 parent 84515bb commit 8ee1f5b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Clean/HtmlCleaner.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ public function cleanRelativeUrls()
if ($links->item($i)->nodeValue !== "") {
$span = $this->dom->DOMDocument->createElement('span', $links->item($i)->nodeValue);
$this->dom->replaceElement($links->item($i), $span);
} else {
} elseif ($links->item($i)->getElementsByTagName('img')->length !== 0) {
//in case of none nodeValue expect that image exist on child element
$this->dom->replaceElement($links->item($i), $links->item($i)->getElementsByTagName('img')[0]);
}
Expand Down Expand Up @@ -176,4 +176,4 @@ public function useDomAfterPurify(?Closure $domRunner)
$this->domRunnerAfterPurify = $domRunner;
}

}
}

0 comments on commit 8ee1f5b

Please sign in to comment.