shorten_expanded: no need to hook on HOOK_SANITIZE anymore

This commit is contained in:
Andrew Dolgov 2021-03-10 16:34:27 +03:00
parent fb89c3bad0
commit 668b0ac7a6
1 changed files with 0 additions and 16 deletions

View File

@ -10,22 +10,6 @@ class Shorten_Expanded extends Plugin {
function init($host) {
$this->host = $host;
$host->add_hook($host::HOOK_SANITIZE, $this);
}
// native lazy loading messes with plugin height calculation because images get loaded
// after headline is actually rendered (off screen) so we force disable it
function hook_sanitize($doc) {
$xpath = new DOMXPath($doc);
$entries = $xpath->query('(//*[@loading="lazy"])');
foreach ($entries as $entry) {
$entry->removeAttribute("loading");
}
return $doc;
}
function get_css() {