Skip to content
Snippets Groups Projects
Commit de1b9acb authored by Andrew Dolgov's avatar Andrew Dolgov
Browse files

af_comics: simplify srcset attribute handling for gocomics pseudo-feeds

parent 2ab49fec
No related branches found
No related tags found
1 merge request!1Update 19.2
......@@ -124,16 +124,9 @@ class Af_Comics extends Plugin {
$node = $xpath->query('//picture[contains(@class, "item-comic-image")]/img')->item(0);
if ($node) {
$node->removeAttribute("width");
if ($node->hasAttribute("srcset") && preg_match("|/transparent\.png$|", $node->getAttribute("srcset"))) {
if ($node->hasAttribute("data-srcset")) {
$node->setAttribute("srcset", $node->getAttribute("data-srcset"));
$node->removeAttribute("data-srcset");
} elseif ($node->hasAttribute("src")) {
$node->removeAttribute("srcset");
}
}
$node->removeAttribute("width");
$node->removeAttribute("data-srcset");
$node->removeAttribute("srcset");
$tpl->setVariable('ARTICLE_ID', $article_link, true);
$tpl->setVariable('ARTICLE_LINK', $article_link, true);
......@@ -146,6 +139,7 @@ class Af_Comics extends Plugin {
$tpl->setVariable('ARTICLE_SOURCE_TITLE', $feed_title, true);
$tpl->addBlock('entry');
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment