]> git.wh0rd.org Git - tt-rss.git/commitdiff
use dom to generate linebreaks after images in articles
authorAndrew Dolgov <fox@madoka.volgo-balt.ru>
Thu, 11 Nov 2010 12:54:30 +0000 (15:54 +0300)
committerAndrew Dolgov <fox@madoka.volgo-balt.ru>
Thu, 11 Nov 2010 12:54:30 +0000 (15:54 +0300)
functions.php
tt-rss.css

index 126ad27c611e4a87330d6cf8333240da219adf19..f94da95252e48fec8e626d5ef2f7f6a127df836a 100644 (file)
                                                rewrite_relative_url($site_url, $entry->getAttribute('src')));
                        }
 
-                       if (get_pref($link, 'OPEN_LINKS_IN_NEW_WINDOW', $owner)) {
-                               $entry->setAttribute("target", "_blank");
+                       if (strtolower($entry->nodeName) == "a") {
+                               if (get_pref($link, 'OPEN_LINKS_IN_NEW_WINDOW', $owner)) {
+                                       $entry->setAttribute("target", "_blank");
+                               }
+                       }
+
+                       if (strtolower($entry->nodeName) == "img") {
+                               $br = $doc->createElement("br");
+
+                               if ($entry->parentNode->nextSibling)
+                                       $entry->parentNode->insertBefore($br, $entry->nextSibling);
+
                        }
                }
        
index 0fbd1d93e0f2f6728788d1068596dd4c0dbe71e5..09a1957ec2eb8bd4032de2d0744e53a5566006d4 100644 (file)
@@ -46,7 +46,6 @@ div.postReply div.postContent {
 div.postReply div.postContent img {
        border-width : 0px;
        max-width : 98%;
-       display : block;
 }
 
 div.postReply div.postIcon {