af_readability: use data-src for images if available

data-src is popular attribute to store original images for lazy loading via javascript
This commit is contained in:
Eugene Molotov 2022-01-09 14:51:36 +05:00
parent f1607902e6
commit ac6a34f097
No known key found for this signature in database
GPG Key ID: BE799F3FAB51151B
1 changed files with 6 additions and 1 deletions

View File

@ -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));
}
}