diff --git a/mediapart.php b/mediapart.php index 964f8b0..afc4520 100644 --- a/mediapart.php +++ b/mediapart.php @@ -51,10 +51,21 @@ foreach ($items as $item) $doc->loadHTML($article); $finder = new DomXPath($doc); - $svgs = $finder->query('//svg'); - foreach ($svgs as $svg) + // strip images + $toremove = $finder->query('//svg'); + foreach ($toremove as $elt) { - $svg->parentNode->removeChild($svg); + $elt->parentNode->removeChild($elt); + } + $toremove = $finder->query('//figure'); + foreach ($toremove as $elt) + { + $elt->parentNode->removeChild($elt); + } + $toremove = $finder->query('//span[@class="screen-reader-only"]'); + foreach ($toremove as $elt) + { + $elt->parentNode->removeChild($elt); } $result = '
') . '