From 62b7ae5a8e9db37ed5e882ee94431a02ce821644 Mon Sep 17 00:00:00 2001 From: quenousimporte Date: Mon, 2 Sep 2024 18:22:50 +0200 Subject: [PATCH] Revert "remove useless code" This reverts commit a9308fe161475348eb2ecbc13b56705fca7da89d. --- epub.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/epub.php b/epub.php index f54496d..dae0171 100644 --- a/epub.php +++ b/epub.php @@ -41,6 +41,23 @@ $date = trim($finder->query('//time')->item(1)->textContent); $summary = $finder->query('//p[contains(@class, "news__heading__top__intro")]')->item(0)->textContent; + // strip images + $toremove = $finder->query('//svg'); + foreach ($toremove as $elt) + { + $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 = '

' . $title . '

'; $result .= '

' . $author . '

'; $result .= '

' . $date . '

';