]> git.wh0rd.org - tt-rss.git/commitdiff
remove LIBXML_NOEMPTYTAG because of double <br/>s - the #357 issue with
authorAndrew Dolgov <fox@madoka.volgo-balt.ru>
Sat, 16 Mar 2013 12:07:11 +0000 (16:07 +0400)
committerAndrew Dolgov <fox@madoka.volgo-balt.ru>
Sat, 16 Mar 2013 12:07:11 +0000 (16:07 +0400)
htmlpurifier might not be relevant anymore because of htmLawed switch,
but <br/>s are annoying

include/functions.php
include/rssfuncs.php
plugins/af_buttersafe/init.php
plugins/af_explosm/init.php
plugins/af_gocomics/init.php
plugins/af_pennyarcade/init.php
plugins/af_redditimgur/init.php

index 4e16c9f19d380e149ec36c47527217b9eaa2ed8a..dd40b9529f21aa94099e500c69ba7e634f16757a 100644 (file)
                $xpath = new DOMXPath($doc);
 
                $entries = $xpath->query('(//a[@href]|//img[@src])');
-               $br_inserted = 0;
 
                foreach ($entries as $entry) {
 
                        if (strtolower($entry->nodeName) == "a") {
                                $entry->setAttribute("target", "_blank");
                        }
-
-                       if (strtolower($entry->nodeName) == "img" && !$br_inserted) {
-                               $br = $doc->createElement("br");
-
-                               if ($entry->parentNode->nextSibling) {
-                                       $entry->parentNode->insertBefore($br, $entry->nextSibling);
-                                       $br_inserted = 1;
-                               }
-
-                       }
                }
 
                $node = $doc->getElementsByTagName('body')->item(0);
 
-               // http://tt-rss.org/redmine/issues/357
-               return $doc->saveXML($node, LIBXML_NOEMPTYTAG);
+               return $doc->saveXML($node);
        }
 
        function check_for_update($link) {
 
                // http://tt-rss.org/forum/viewtopic.php?f=1&t=970
                if ($node)
-                       return $doc->saveXML($node, LIBXML_NOEMPTYTAG);
+                       return $doc->saveXML($node);
                else
                        return $html;
        }
index 0b1d06564c3d93547f7b1f4a7635e473d28d22b9..feffe0019b8242478787717998fd3de1faaa766c 100644 (file)
 
                $node = $doc->getElementsByTagName('body')->item(0);
 
-               return $doc->saveXML($node, LIBXML_NOEMPTYTAG);
+               return $doc->saveXML($node);
        }
 
        function expire_lock_files($debug) {
                        $node = $doc->getElementsByTagName('body')->item(0);
 
                        if ($node) {
-                               $content = $doc->saveXML($node, LIBXML_NOEMPTYTAG);
+                               $content = $doc->saveXML($node);
 
                                return $content;
                        }
index 12833540b8aace0e80f70fc94eecf4500cc5e71a..c9f6505cddbb89e1f2f28e6ad60246063e521e05 100644 (file)
@@ -44,7 +44,7 @@ class Af_Buttersafe extends Plugin {
                                        }
 
                                        if ($basenode) {
-                                               $article["content"] = $doc->saveXML($basenode, LIBXML_NOEMPTYTAG);
+                                               $article["content"] = $doc->saveXML($basenode);
                                                $article["plugin_data"] = "buttersafe,$owner_uid:" . $article["plugin_data"];
                                        }
                                }
index 701eafeeb15befeabf0238fa9676a97e5f1857d3..2a8fab491416bd43c308ec76c2d63f7623c190d7 100644 (file)
@@ -44,7 +44,7 @@ class Af_Explosm extends Plugin {
                                        }
 
                                        if ($basenode) {
-                                               $article["content"] = $doc->saveXML($basenode, LIBXML_NOEMPTYTAG);
+                                               $article["content"] = $doc->saveXML($basenode);
                                                $article["plugin_data"] = "explosm,$owner_uid:" . $article["plugin_data"];
                                        }
                                }
index da5242595e93da146d426913a9a68cdbaca5fc6c..466ec9687a34f525ffa8fa8081dad2df54b8351b 100644 (file)
@@ -44,7 +44,7 @@ class Af_GoComics extends Plugin {
                                        }
 
                                        if ($basenode) {
-                                               $article["content"] = $doc->saveXML($basenode, LIBXML_NOEMPTYTAG);
+                                               $article["content"] = $doc->saveXML($basenode);
                                                $article["plugin_data"] = "gocomics,$owner_uid:" . $article["plugin_data"];
                                        }
                                }
index bf07b94a7f40a4cda8cfa5e3d861d13c7031ba38..26d19bc0172375c9a2d44a24a51c3960179675e2 100644 (file)
@@ -44,7 +44,7 @@ class Af_PennyArcade extends Plugin {
                                        }
 
                                        if ($basenode) {
-                                               $article["content"] = $doc->saveXML($basenode, LIBXML_NOEMPTYTAG);
+                                               $article["content"] = $doc->saveXML($basenode);
                                                $article["plugin_data"] = "pennyarcade,$owner_uid:" . $article["plugin_data"];
                                        }
                                }
index b2bc975e253dc1b2970d3a31c7fa7d567ba8624d..2bb44f6d3973200b3af0d9d2803cadd81984ee3f 100644 (file)
@@ -113,7 +113,7 @@ class Af_RedditImgur extends Plugin {
                                        $node = $doc->getElementsByTagName('body')->item(0);
 
                                        if ($node && $found) {
-                                               $article["content"] = $doc->saveXML($node, LIBXML_NOEMPTYTAG);
+                                               $article["content"] = $doc->saveXML($node);
                                                if (!$force) $article["plugin_data"] = "redditimgur,$owner_uid:" . $article["plugin_data"];
                                        }
                                }