From ac6a34f097dfa79ed54e8393514549241f9bdbba Mon Sep 17 00:00:00 2001 From: Eugene Molotov Date: Sun, 9 Jan 2022 14:51:36 +0500 Subject: [PATCH] af_readability: use data-src for images if available data-src is popular attribute to store original images for lazy loading via javascript --- plugins/af_readability/init.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/plugins/af_readability/init.php b/plugins/af_readability/init.php index a13f2a5b2..cf753ee6b 100755 --- a/plugins/af_readability/init.php +++ b/plugins/af_readability/init.php @@ -233,8 +233,13 @@ class Af_Readability extends Plugin { } if ($entry->hasAttribute("src")) { + if ($entry->hasAttribute("data-src")) { + $src = $entry->getAttribute("data-src"); + } else { + $src = $entry->getAttribute("src"); + } $entry->setAttribute("src", - UrlHelper::rewrite_relative(UrlHelper::$fetch_effective_url, $entry->getAttribute("src"))); + UrlHelper::rewrite_relative(UrlHelper::$fetch_effective_url, $src)); } }