diff options
author | Andrew Dolgov <[email protected]> | 2010-11-11 15:54:30 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2010-11-11 15:54:30 +0300 |
commit | fa403733954f809286936d2ad3e39d3ab5395c26 (patch) | |
tree | 036e88f613cc0a67885f7d4cafb104af1b08946d | |
parent | 2ab31493c9732d34185274582aae4bc4e3351f7f (diff) |
use dom to generate linebreaks after images in articles
-rw-r--r-- | functions.php | 14 | ||||
-rw-r--r-- | tt-rss.css | 1 |
2 files changed, 12 insertions, 3 deletions
diff --git a/functions.php b/functions.php index 126ad27c6..f94da9525 100644 --- a/functions.php +++ b/functions.php @@ -3751,8 +3751,18 @@ 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); + } } diff --git a/tt-rss.css b/tt-rss.css index 0fbd1d93e..09a1957ec 100644 --- a/tt-rss.css +++ b/tt-rss.css @@ -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 { |