From 10f26c2ae98dd1414e3b84fea400478f28d742a6 Mon Sep 17 00:00:00 2001 From: Aleteoryx Date: Thu, 14 Nov 2024 17:53:05 -0500 Subject: better stripping --- rss.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/rss.php b/rss.php index 4efb696..2669085 100644 --- a/rss.php +++ b/rss.php @@ -175,6 +175,19 @@ function strip_html(string $html): string { $el->remove(); foreach($doc->getElementsByTagName("link")->getIterator() as $el) $el->remove(); + foreach($doc->getElementsByTagName("meta")->getIterator() as $el) + $el->remove(); + foreach($doc->getElementsByTagName("base")->getIterator() as $el) + $el->remove(); + foreach($doc->getElementsByTagName("title")->getIterator() as $el) + $el->remove(); + foreach($doc->getElementsByTagName("template")->getIterator() as $el) + $el->remove(); + foreach($doc->getElementsByTagName("slot")->getIterator() as $el) + $el->remove(); + + foreach($doc->getElementsByTagName("img")->getIterator() as $el) + $el->setAttribute("loading", "lazy"); foreach($doc->getElementsByTagName("*")->getIterator() as $el) { if (str_starts_with($el->getAttribute("href"), "javascript:")) -- cgit v1.2.3-54-g00ecf