]> git.wh0rd.org Git - tt-rss.git/commitdiff
af_redditimgur: insert br after image
authorAndrew Dolgov <fox@madoka.volgo-balt.ru>
Tue, 2 Apr 2013 06:01:52 +0000 (10:01 +0400)
committerAndrew Dolgov <fox@madoka.volgo-balt.ru>
Tue, 2 Apr 2013 06:01:52 +0000 (10:01 +0400)
plugins/af_redditimgur/init.php

index 2bb44f6d3973200b3af0d9d2803cadd81984ee3f..f2d5c7b674906712e634e7f6d1ad8f72b1abfda4 100644 (file)
@@ -40,7 +40,9 @@ class Af_RedditImgur extends Plugin {
                                                                $img = $doc->createElement('img');
                                                                $img->setAttribute("src", $entry->getAttribute("href"));
 
-                                                               $entry->parentNode->replaceChild($img, $entry);
+                                                               $br = $doc->createElement('br');
+                                                               $entry->parentNode->insertBefore($img, $entry);
+                                                               $entry->parentNode->insertBefore($br, $entry);
 
                                                                $found = true;
                                                        }
@@ -66,7 +68,12 @@ class Af_RedditImgur extends Plugin {
                                                                                        if (preg_match("/^http:\/\/i.imgur.com\/$token\./", $aentry->getAttribute("src"))) {
                                                                                                $img = $doc->createElement('img');
                                                                                                $img->setAttribute("src", $aentry->getAttribute("src"));
+
+                                                                                               $br = $doc->createElement('br');
+
                                                                                                $entry->parentNode->insertBefore($img, $entry);
+                                                                                               $entry->parentNode->insertBefore($br, $entry);
+
                                                                                                $found = true;
 
                                                                                                break;
@@ -94,7 +101,12 @@ class Af_RedditImgur extends Plugin {
                                                                                        $img = $doc->createElement('img');
                                                                                        $img->setAttribute("src", $aentry->getAttribute("href"));
                                                                                        $entry->parentNode->insertBefore($doc->createElement('br'), $entry);
+
+                                                                                       $br = $doc->createElement('br');
+
                                                                                        $entry->parentNode->insertBefore($img, $entry);
+                                                                                       $entry->parentNode->insertBefore($br, $entry);
+
                                                                                        $found = true;
                                                                                }
                                                                        }