af_redditimgur: do not reinline content extracted by readability

This commit is contained in:
Andrew Dolgov 2015-07-09 09:39:45 +03:00
parent 8b08d9d740
commit 47888b3d87

View file

@ -272,7 +272,6 @@ class Af_RedditImgur extends Plugin {
$r = new Readability($tmp, $content_link->getAttribute("href")); $r = new Readability($tmp, $content_link->getAttribute("href"));
if ($r->init()) { if ($r->init()) {
//$article["content"] = $r->articleContent->innerHTML . "<hr/>" . $article["content"];
$tmpxpath = new DOMXPath($r->dom); $tmpxpath = new DOMXPath($r->dom);
@ -295,11 +294,13 @@ class Af_RedditImgur extends Plugin {
$article["content"] = $r->articleContent->innerHTML . "<hr/>" . $article["content"]; $article["content"] = $r->articleContent->innerHTML . "<hr/>" . $article["content"];
$doc = new DOMDocument(); // prob not a very good idea (breaks wikipedia pages, etc) -
@$doc->loadHTML($article["content"]); // inliner currently is not really fit for any random web content
$xpath = new DOMXPath($doc);
$found = $this->inline_stuff($article, $doc, $xpath); //$doc = new DOMDocument();
//@$doc->loadHTML($article["content"]);
//$xpath = new DOMXPath($doc);
//$found = $this->inline_stuff($article, $doc, $xpath);
} }
} }
} }